@database Amiga_C_List.guide @width 70 @node "Introduction" "Introduction" @wordwrap Amiga-C Mailing List Guide ========================== This guide is intended as an easy reference to the Amiga C mailing list. It contains messages posted to the Amiga C mailing list during the month shown on the main page. To subscribe to the Amiga C mailing list, search for amiga-c at Onelist. http://www.onelist.com This AmigaGuide was created using GuideMaker.rexx Roger Light 1999 Comments should be sent to Tim Hanson at msinister@connectfree.co.uk @endnode @node "Main" "Amiga C Mailing List Guide" @{b}Amiga C Mailing List Guide ==========================@{ub} Jan 2000 @{" Introduction " link Introduction } Introduction to the guide. @{" Search " SYSTEM "RUN <>NIL: Searchguide FINAME"} Search this file (requres SearchGuide) ------------------------------------------------------------------- @{" Re: lowlevel.library and 060 " Link "Mail_0"} Mike Carter @{" Re: Check your sources for Y2K bugs! " Link "Mail_1"} Allan Odgaard @{" LoadSeg() " Link "Mail_2"} Charles Barr @{" Re: Check your sources for Y2K bugs! " Link "Mail_3"} Andrew Bell @{" SAS/C SE Configuration problem " Link "Mail_4"} jsteic1957@aol.com @{" Re: SAS/C SE Configuration problem " Link "Mail_5"} meyersfamily @{" A virtual delete operator? " Link "Mail_6"} Allan Odgaard @{" Re: LoadSeg() " Link "Mail_7"} Colin Wenzel @{" SAS/C Date Problem " Link "Mail_8"} Bablos @{" AmigaOS 3.5 & ReadPixelLine8() " Link "Mail_9"} Niels de Koning @{" Register usage for doubles " Link "Mail_10"} ROBERT MEYERS @{" FPrintf() equivalent? " Link "Mail_11"} W1bBle @{" Re: FPrintf() equivalent? " Link "Mail_12"} Oliver Roberts @{" Re: A virtual delete operator? " Link "Mail_13"} "Nathan J. Young" @{" BOOPSI Prop Gadgets " Link "Mail_14"} "Alastair M. Robinson" @{" Re: A virtual delete operator? " Link "Mail_15"} Allan Odgaard @{" off the topic. " Link "Mail_16"} Dr Brain Damage @{" Quick Q about Palette gads " Link "Mail_17"} Daithi O'Cuinn @{" Re: Quick Q about Palette gads " Link "Mail_18"} Laura Vance @{" Problems with active object... " Link "Mail_19"} "Andrzej J. Debicki" @{" Re: Problems with active object... " Link "Mail_20"} Allan Odgaard @{" Windows " Link "Mail_21"} Steffen @{" Re: Quick Q about Palette gads " Link "Mail_22"} Daithi O'Cuinn @{" Re: Re: Quick Q about Palette gads " Link "Mail_23"} Gregory Roberts II @{" The future of StormAmiga.lib!!! " Link "Mail_24"} Allan Odgaard @{" Re: Re: Quick Q about Palette gads " Link "Mail_25"} David McMinn @{" Tasks " Link "Mail_26"} Andrew Bell @{" Re: Tasks " Link "Mail_27"} Laura Vance @{" Re: Tasks " Link "Mail_28"} Andrew Bell @{" Re: Re: Tasks " Link "Mail_29"} Duane McDonnell @{" Re: Re: Problems with active object... " Link "Mail_30"} "Andrzej J. Debicki" @{" Re: Re: Tasks " Link "Mail_31"} Duane McDonnell @{" Re: Re: Tasks " Link "Mail_32"} Nicholas Clarke @{" Re: Re: Tasks " Link "Mail_33"} Duane McDonnell @{" Re: Tasks " Link "Mail_34"} Andrew Bell @{" Re: Quick Q about Palette gads " Link "Mail_35"} Bob Lanham @{" Re: Tasks " Link "Mail_36"} Duane McDonnell @{" Re: Windows " Link "Mail_37"} Tak Tang @{" Re: Re: Tasks " Link "Mail_38"} Duane McDonnell @{" Re: Quick Q about Palette gads " Link "Mail_39"} Daithi O'Cuinn @{" Re: Windows " Link "Mail_40"} Laura Vance @{" Re: Tasks " Link "Mail_41"} Laura Vance @{" Re: Re: Tasks " Link "Mail_42"} Nicholas Clarke @{" Re: Windows " Link "Mail_43"} Steffen @{" Re: Windows " Link "Mail_44"} Steffen @{" Re: Tasks " Link "Mail_45"} Duane McDonnell @{" Re: Re: Tasks " Link "Mail_46"} Duane McDonnell @{" List Newbie + VBCC/BOOPSI questions " Link "Mail_47"} "Sealey, M." @{" Re: Tasks " Link "Mail_48"} Allan Odgaard @{" Compiling for PPC " Link "Mail_49"} Kim Sindalsen @{" Re: Tasks " Link "Mail_50"} Ilkka Lehtoranta @{" Re: Tasks " Link "Mail_51"} Tak Tang @{" Re: Re: Tasks " Link "Mail_52"} Olaf Barthel @{" a2ixlibrary " Link "Mail_53"} Joar Sivertsen @{" pure programs " Link "Mail_54"} Linus McCabe @{" Re: a2ixlibrary " Link "Mail_55"} Joar Sivertsen @{" Re: Tasks " Link "Mail_56"} Andrew Bell @{" Re: Tasks " Link "Mail_57"} Andrew Bell @{" Re: pure programs " Link "Mail_58"} Linus McCabe @{" Re: Tasks " Link "Mail_59"} Ilkka Lehtoranta @{" Re: pure programs " Link "Mail_60"} Duane McDonnell @{" Re: Re: Tasks " Link "Mail_61"} Duane McDonnell @{" Re: pure programs " Link "Mail_62"} Linus McCabe @{" Re: pure programs " Link "Mail_63"} Jonas Hulten @{" Re: pure programs " Link "Mail_64"} Stephen Illingworth @{" Re: List Newbie + VBCC/BOOPSI questions " Link "Mail_65"} "Nathan J. Young" @{" Screen colors wrong " Link "Mail_66"} Jack York @{" Can somebody with OS35 do a test for me? " Link "Mail_67"} Niels de Koning @{" Re: pure programs " Link "Mail_68"} Colin Wenzel @{" Re: Re: pure programs " Link "Mail_69"} Duane McDonnell @{" RE: Re: List Newbie + VBCC/BOOPSI questions " Link "Mail_70"} "Sealey, M." @{" HiSOFT C++ and MUI and Hooks... " Link "Mail_71"} Alexander Niven-Jenkins @{" Re: List Newbie + VBCC/BOOPSI questions " Link "Mail_72"} "Nathan J. Young" @{" Re: HiSOFT C++ and MUI and Hooks... " Link "Mail_73"} Allan Odgaard @{" Re: HiSOFT C++ and MUI and Hooks... " Link "Mail_74"} Alexander Niven-Jenkins @{" HiSOFT C++ and starting from WB... " Link "Mail_75"} Alexander Niven-Jenkins @{" HiSOFT C++ and starting from WB... " Link "Mail_76"} Tak Tang @{" Joysticks " Link "Mail_77"} "Alastair M. Robinson" @{" Re: HiSOFT C++ and starting from WB... " Link "Mail_78"} Andrew Bell @{" How to print text fast? " Link "Mail_79"} Allan Odgaard @{" About CGI scripts in C++ and address correction. " Link "Mail_80"} Dr Brain Damage @{" Re: HiSOFT C++ and starting from WB... " Link "Mail_81"} Alexander Niven-Jenkins @{" Re: How to print text fast? " Link "Mail_82"} Duane McDonnell @{" Re: How to print text fast? " Link "Mail_83"} Duane McDonnell @{" Re: About CGI scripts in C++ and address correction. " Link "Mail_84"} Allan Odgaard @{" Re: How to print text fast? " Link "Mail_85"} Allan Odgaard @{" Re: How to print text fast? " Link "Mail_86"} Allan Odgaard @{" Re: Re: About CGI scripts in C++ and address correction. " Link "Mail_87"} Andrija Antonijevic @{" Re: About CGI scripts in C++ and address correction. " Link "Mail_88"} Allan Odgaard @{" Re: About CGI scripts in C++ and address correction. " Link "Mail_89"} Duane McDonnell @{" Re: About CGI scripts in C++ and address correction. " Link "Mail_90"} Stephen Illingworth @{" Re: Re: How to print text fast? " Link "Mail_91"} Duane McDonnell @{" HiSOFT C++ and starting from WB... " Link "Mail_92"} "Alastair M. Robinson" @{" Re: psx controler help request. " Link "Mail_93"} "William W. Toner II" @{" psx controler help request. " Link "Mail_94"} Steven Dobbs @{" Re: psx controler help request. " Link "Mail_95"} Alexander Niven-Jenkins @{" Re: psx controler help request. " Link "Mail_96"} Kelly Samel @{" should I make my config.library public ??? " Link "Mail_97"} David Arbuthnot @{" Re: should I make my config.library public ??? " Link "Mail_98"} Christian Hattemer @{" Re: HiSOFT C++ and starting from WB... " Link "Mail_99"} Alexander Niven-Jenkins @{" NewObject() from a seperate process??? " Link "Mail_100"} David Arbuthnot @{" Pattern dither in Adobe Photoshop, how and what? " Link "Mail_101"} Allan Odgaard @{" Pattern dither follow up. " Link "Mail_102"} Allan Odgaard @{" Screensavers " Link "Mail_103"} ddawn347@yahoo.com @{" Begginners-question regarding memory allocation " Link "Mail_104"} Stephan Huebner @{" Re: Begginners-question regarding memory allocation " Link "Mail_105"} Christian Hattemer @{" Bad Link Library " Link "Mail_106"} David Arbuthnot @{" Re: Begginners-question regarding memory allocation " Link "Mail_107"} Charles Barr @{" Re: Begginners-question regarding memory allocation " Link "Mail_108"} Tim Hanson @{" Re: Begginners-question regarding memory allocation " Link "Mail_109"} Stephan Huebner @{" Re: Begginners-question regarding memory allocation " Link "Mail_110"} Stephan Huebner @{" Re: Begginners-question regarding memory allocation " Link "Mail_111"} Andrew Bell @{" Re: Begginners-question regarding memory allocation " Link "Mail_112"} Charles Barr @{" Re: Begginners-question regarding memory allocation (+attachments) " Link "Mail_113"} "Nathan J. Young" @{" Re: Re: Begginners-question regarding memory allocation (+attachments " Link "Mail_114"} Duane McDonnell @{" Pattern dither in Adobe Photoshop, how and what? " Link "Mail_115"} "Alastair M. Robinson" @{" Re: Begginners-question regarding memory allocation (+attachments) " Link "Mail_116"} Stephan Huebner @{" Re: Begginners-question regarding memory allocation " Link "Mail_117"} Stephan Huebner @{" Re: Begginners-question regarding memory allocation (+attachments) " Link "Mail_118"} Allan Odgaard @{" Re: Begginners-question regarding memory allocation " Link "Mail_119"} Charles Barr @{" Mui future. " Link "Mail_120"} Vincent Morenas @{" Re: Begginners-question regarding memory allocation " Link "Mail_121"} Christian Hattemer @{" Re: Begginners-question regarding memory allocation " Link "Mail_122"} Jack York @{" Re: Begginners-question regarding memory allocation (+attachments) " Link "Mail_123"} "Nathan J. Young" @{" Re: Begginners-question regarding memory allocation " Link "Mail_124"} Ilkka Lehtoranta @{" Re: Mui future. " Link "Mail_125"} Ilkka Lehtoranta @{" Re: Begginners-question regarding memory allocation " Link "Mail_126"} roderick_maclean@agilent.com @{" Re: Begginners-question regarding memory allocation " Link "Mail_127"} roderick_maclean@agilent.com @{" "explode" image " Link "Mail_128"} andrewmarkwell@ukonline.co.uk @{" Geek gadgets CD " Link "Mail_129"} Charles Barr @{" Telling when printing is stopped. " Link "Mail_130"} Charles Barr @{" AW: Geek gadgets CD " Link "Mail_131"} Fritsch Alexander @{" Odp: Pattern dither in Adobe Photoshop, how and what? " Link "Mail_132"} Michal Bartczak @{" Hello there! I'm new here! ; ) " Link "Mail_133"} fgloch@yahoo.com @{" Bobs and GELS " Link "Mail_134"} Lee Atkins @{" Re: Pattern dither in Adobe Photoshop, how and what? " Link "Mail_135"} Allan Odgaard @{" Re: "explode" image " Link "Mail_136"} Duane McDonnell @ENDNODE @NODE "Mail_0" " Re: lowlevel.library and 060 " From: Mike Carter Date: 12-28-99 00:16:27 Subject: @{b}Re: lowlevel.library and 060@{ub} From: Mike Carter Hi Tim thanks for your mail that I got on 15-Dec-99 > Can anyone confirm or deny this problem? Does anyone > have some joypad reading code either in C or PPC > assembler? Somebody sent a test program to the list a while back. I tested it on my 060 and it appeared to be responding to all buttons fine! And the games which do use the lowlevel.library all work fine (AFAIK). I think Wipeout2097 uses lowlevel.library on PPC? - The demo was perfect on my machine. Hope this is of help - I'll be willing to test your code on my machine. Contact me direct before sending anything though :) Cheers, M!Ke C. .--------------------------------- ---- - -- --------. | AMiGA 1200EZT 060/PPC@240Mhz,50Mb RAM __/\__ | | 4 HDD,DD FD,5 CD-ROMS,CDrW,ZiP250 \ o0 / bUDDa/S^D| | SCSI+IDE,56kModem,BVGfX,19"VDU /_'-_\ | `------------------------------- --- - \/ -- ------' http://fly.to/BuddasWurld ICQ: 29173597 @ENDNODE @NODE "Mail_1" " Re: Check your sources for Y2K bugs! " From: Allan Odgaard Date: 01-01-00 13:17:28 Subject: @{b}Re: Check your sources for Y2K bugs!@{ub} From: Allan Odgaard On 31-Dec-99, Andrew Bell wrote: > "x = '%x' (shorthand date)\n" Is the shorthand format defined? Or is this up to the implementer? I'm asking because the standard StormC link library prints 'Jan 01 2000' where the StormAmiga link lib outputs '01/01/00'. IMHO the first isn't really shorthand notation... Regards Allan URL: http://www.DIKU.dk/students/duff/ Press any key to continue or any other key to quit... @ENDNODE @NODE "Mail_2" " LoadSeg() " From: Charles Barr Date: 01-01-00 18:52:38 Subject: @{b}LoadSeg()@{ub} From: Charles Barr Hello, Im trying to implement a module system. Each module implements defined function. They will be compiled as object code by the use and loaded in using LoadSeg. I want to keep all the modules in a list. But How do I call the function that is in the loaded object code. Kind regards Charles Barr Emerald Amiga Users URL: http://www.emerald.org.uk/wordpad/ Some people hope to achieve immortality through their works or their children. I would prefer to achieve it by not dying. -- Woody Allen @ENDNODE @NODE "Mail_3" " Re: Check your sources for Y2K bugs! " From: Andrew Bell Date: 01-01-00 19:03:33 Subject: @{b}Re: Check your sources for Y2K bugs!@{ub} From: Andrew Bell Hi Allan, On 01-Jan-00 you wrote: [amiga-c] Re: Check your sources for Y2K bugs! >> "x = '%x' (shorthand date)\n" > Is the shorthand format defined? Or is this up to the implementer? I don't know. > I'm asking because the standard StormC link library prints 'Jan 01 > 2000' where the StormAmiga link lib outputs '01/01/00'. IMHO the > first isn't really shorthand notation... The term "shorthand" comes from the Hisoft C++ docs, I'm not sure if it's correct or not. As for the format, Hisoft should print out this format "Jan 01 2000", but because of a Y2K bug, instead gives "Jan 01 20". :-/ Regards, Andrew Bell. +----------------------------------------+ email: mailto:andrew.ab2000@bigfoot.com or mailto:andrew@ab2000.prestel.co.uk web: http://www2.prestel.co.uk/ab2000 +----------------------------------------+ Phone your Moderator at 3 A.M. for free taglines...!!!! @ENDNODE @NODE "Mail_4" " SAS/C SE Configuration problem " From: jsteic1957@aol.com Date: 01-02-00 02:25:46 Subject: @{b}SAS/C SE Configuration problem@{ub} From: jsteic1957@aol.com TO: Bob Lanham FROM: Jim Steichen Subject: Re: SE version 6.58 Bug? > Anyone else noticed that SAS/C editor SE version 6.58 is broke regarding > configuration settings? > I've used it to change the text colors, and had no problems. What > problem did it give you? Really? You got your 6.58 SE to change the text colors? I can't even get mine to do that. The menu item for setting/selecting how SE displays C source code doesn't even show up anymore. I told the guy that was taking care of the SAS-C updates about this, but he didn't seem to know what I was complaining about. It would be helpful if there was some documentation on how the se.dat file is constructed. Saving the changes I make to SE's configuration seem to cause the OS (V3.5) some sort of grief since it slows down & finally recovers. @ENDNODE @NODE "Mail_5" " Re: SAS/C SE Configuration problem " From: meyersfamily Date: 01-02-00 04:39:04 Subject: @{b}Re: SAS/C SE Configuration problem@{ub} From: meyersfamily Haven't had that particular problem. But I'm using the 6.57 version of SE and it's fine. -----------Reply Seperator--------- > From: jsteic1957@aol.com > TO: Bob Lanham > FROM: Jim Steichen > Subject: Re: SE version 6.58 Bug? >> Anyone else noticed that SAS/C editor SE version 6.58 is broke regarding >> configuration settings? >> I've used it to change the text colors, and had no problems. What >> problem did it give you? > Really? You got your 6.58 SE to change the text colors? I can't even > get mine to do that. The menu item for setting/selecting how SE displays > C source code doesn't even show up anymore. I told the guy that was > taking care of the SAS-C updates about this, but he didn't seem to know > what I was complaining about. It would be helpful if there was some > documentation on how the se.dat file is constructed. Saving the changes > I make to SE's configuration seem to cause the OS (V3.5) some sort of > grief since it slows down & finally recovers. @ENDNODE @NODE "Mail_6" " A virtual delete operator? " From: Allan Odgaard Date: 01-02-00 13:02:04 Subject: @{b}A virtual delete operator?@{ub} Hi there, Imagine I overload new & delete for my Dummy-class. Then I create a subclass where I do the same. Now if I delete an instance of the subclass, but with the pointer declared as 'class Dummy *' then the delete operator of my superclass is invoked. Normally I'd declare a function 'virtual' to avoid this problem, but that doesn't seem to be possible for the delete operator (only the destructor) -- so what should I do? I attached a small program to illustrate the problem better. It prints: Super-alloc 0 bytes Sub-alloc 0 bytes Super-Free 0 bytes at 099e639c Super-Free 0 bytes at 099e6394 But I want it to say: Super-alloc 0 bytes Sub-alloc 0 bytes Sub-Free 0 bytes at 099e639c Super-Free 0 bytes at 099e6394 Regards Allan URL: http://www.DIKU.dk/students/duff/ Buy Pentium Pro 400MHz! You reboot faster... @ENDNODE @NODE "Mail_7" " Re: LoadSeg() " From: Colin Wenzel Date: 01-02-00 15:11:15 Subject: @{b}Re: LoadSeg()@{ub} From: Colin Wenzel On 02-Jan-00, Charles Barr wrote: > From: Charles Barr > Hello, > Im trying to implement a module system. Each module implements > defined function. They will be compiled as object code by the use and > loaded in using LoadSeg. I want to keep all the modules in a list. > But How do I call the function that is in the loaded object code. Create a library instead, unless you are trying to impliment some sort of executable "plug-in" type system. If so, LoadSeg() only works on executable objects, it returns a BPTR to the segment. Convert it to an (APTR) by: (ulong)pointer <<=2; A BCPL pointer to the next segment is at pointer. (or NULL if no next segment exists) The first instruction begins at 4 bytes past the (APRT) converted pointer. You had better do the startup code in ASM..... ------------------------------------- Colin Wenzel. Australia. EMAIL: mailto:colstv@hotkey.net.au URL: http://www.hotkey.net.au/~colstv/ ICQ: 17608330 MADE WITH 'AMIGA' 4000T With O.S 3.1 --------------------------------------- @ENDNODE @NODE "Mail_8" " SAS/C Date Problem " From: Bablos Date: 01-02-00 15:31:41 Subject: @{b}SAS/C Date Problem@{ub} From: Bablos Hi There... As a number of you will probably know, there's a problem with using __AMIGADATE__ in SAS/C. I'm using 6.58, and include the __AMIGADATE__ as a part of the version string. Today , 2nd Jan 2000, shows up as (2.1.0), which looks more like the programs version number. Is there a way around this? Ideally, I'd like it to say (02.01.2000). I just wonder if there's a special little routine hidden away somewhere which could rectify the problem. Hope someone can help... Bablos. @ENDNODE @NODE "Mail_9" " AmigaOS 3.5 & ReadPixelLine8() " From: Niels de Koning Date: 01-02-00 18:16:35 Subject: @{b}AmigaOS 3.5 & ReadPixelLine8()@{ub} From: Niels de Koning Since I have installed AmigaOS 3.5 one of the command line tools I wrote no longer works as I intended. I have been trying to figure out what is going on but I have to admit that the absence of a nice debug tool is driving me slightly mad. Problem description: When I read a pixelline from a datatype picture object the pixelvalues I get are all zeroes! In more detail: When I use the ReadPixelLine8() function I expect to get an array with values that indicate which palette entry was used for a certain pixel. Before my OS3.5 installation this worked as I expected. Now it no longer works and I have NO IDEA why. Does anybody have any idea what I am doing wrong or who I can ask for help. If you want to see the C-sourcecode let me know and I'll mail it. Anyone? please? btw. The source is for a (very little:-) program that counts the number of unique colors in a picture that is loaded through the Amiga's datatype system. Best regards, // Niels de Koning ____________________________________________________________________ Co-editor on 3D Addict's GFXZone http://www.gfxzone.org @ENDNODE @NODE "Mail_10" " Register usage for doubles " From: ROBERT MEYERS Date: 01-02-00 23:59:20 Subject: @{b}Register usage for doubles@{ub} From: "ROBERT MEYERS" Ok, I some really dumb questions. I'm working on trying to place some commonly used functions of mine into an exec library. Many of the functions take doubles and floats as parameters. An example Autodoc entry is below. My question is how do I specify the registers the doubles and floats will use? Does a double take up two CPU data registers? If it is an array of doubles, do I use an address register like for a pointer? Also, I'd like to have this library be able to use an FPU, I know that the SAS/C fd2pragma utility will not handle the FP0 - FP7 registers in the FPU correctly and I will have to do that manually. For the autodoc entry, is FP0 an acceptable register to specify? If there is a specific passage in the SAS/C Manual, RKM's, or Guru Book concerning these issues please give me a page number. Thanks! Bob Meyers ========================================================================== /* Example partial Autodoc entry. */ * NAME * Coordinate data series * SYNOPSIS * CoordSeries(FDBptr, Scalar, Grades[], Values[], ValCnt, status); * A0 D0 A1 A2 D2 A3 * void CoordSeries(struct FDB *, double, float, const int, int *); * FUNCTION * INPUTS * struct FDB *FDBptr - * double Scalars - * double Grades[] - * float Values[] - * const int ValCnt - * int *statusPtr - @ENDNODE @NODE "Mail_11" " FPrintf() equivalent? " From: W1bBle Date: 01-03-00 04:27:55 Subject: @{b}FPrintf() equivalent?@{ub} From: W1bBle Hi everyone, I'm not sure whether this is the right place to ask this, but here goes.... Is there a function in linux equivalent to FPrintf() under AmigaOS? I desperately need it to port a program of mine. Thanks, Giles @ENDNODE @NODE "Mail_12" " Re: FPrintf() equivalent? " From: Oliver Roberts Date: 01-03-00 20:20:59 Subject: @{b}Re: FPrintf() equivalent?@{ub} From: "Oliver Roberts" On 03-Jan-00 03:27:55 GMT, W1bBle wrote: > Is there a function in linux equivalent to FPrintf() under AmigaOS? I > desperately need it to port a program of mine. Errrm... fprintf() - it's a standard ANSI C function. Of course, you must also use fopen() to open the files, instead of DOS Open(). *Oliver Roberts* - Norwich, UK - Software Developer & Web Designer /oliver.roberts@iname.com/ | /oliver@amigaf1.freeserve.co.uk/ http://www.nanunanu.org/~oliver/ - ICQ: 34640231 The Amiga RC5 Team Effort ==> http://distributed.amiga.org/ @ENDNODE @NODE "Mail_13" " Re: A virtual delete operator? " From: "Nathan J. Young" Date: 01-04-00 20:57:15 Subject: @{b}Re: A virtual delete operator?@{ub} From: "Nathan J. Young" Hi Allan, > Normally I'd declare a function 'virtual' to avoid this problem, but that > doesn't seem to be possible for the delete operator (only the destructor) -- so > what should I do? Just for future reference, the new and delete operators for a class are automatically made static, and static functions can not be virtual. They are defined as being static because they are invoked before and after the life-time of an object! To solve the problem, you just need to define a virtual destructor in your base class (Dummy in your example). Because you have not written destructors for either class, the compiler will conveniently give you one for free. Unfortunately, my version of StormC does not produce the expected result (a possible bug?), but the GNU C++ compiler works fine! Pit-falls like this, and many others are well documented in Scott Meyers' Effective C++ (2nd Edition) and More Effective C++ books. They're worth every penny (as the expression goes :). Kind regards Nathan @ENDNODE @NODE "Mail_14" " BOOPSI Prop Gadgets " From: "Alastair M. Robinson" Date: 01-04-00 22:55:18 Subject: @{b}BOOPSI Prop Gadgets@{ub} Hi guys, Could one of you BOOPSI experts help me out? I'm writing a system hack allowing windows to be scrolled with wheelmice: When my input handler receives a wheelmouse event, my main task hunts for prop gadgets and forges IDCMP_GADGETUP intuimessages from them. This works beautifully with original and gadtools gadgets (and the scrollers in workbench windows), and for windows which don't have recognisable scrollers, I'm forging cursor key movements. The only problem is with programs which ignore key presses, but have scrollers created with BOOPSI, BGUI or ClassAct. My question is this: When trawling through the gadget list of someone else's window, is there any safe way of recognising a gadget created by propgclass? All the best, Alastair M. Robinson, email:blackfive@fakenhamweb.co.uk Amiga 4000/030, 18Meg RAM, 4.3Gig HD, Mustek ScanExpress 6000SP C, Assembler (68k, PIC16C84, learning ATMEL AVR), PostScript, ARexx, AMOSPro(!), AmigaDOS Hardware, n.: The parts of a computer system that can be kicked. @ENDNODE @NODE "Mail_15" " Re: A virtual delete operator? " From: Allan Odgaard Date: 01-04-00 23:11:03 Subject: @{b}Re: A virtual delete operator?@{ub} From: Allan Odgaard On 04-Jan-00, Nathan J. Young wrote: > [...] the problem, you just need to define a virtual destructor in your > base class (Dummy in your example). [...] Unfortunately, my version of > StormC does not produce the expected result (a possible bug?) [...] OK, thanks for clarifying this! I did first try to add a virtual destructor, but it failed -- though after reading your reply I reported it as a bug of StormC (while playing with overloading new & delete for classes I found two other bugs, so it seems that this part of StormC is quite broken :-( ) > Pit-falls like this, and many others are well documented in Scott Meyers' > Effective C++ (2nd Edition) and More Effective C++ books. They're worth > every penny (as the expression goes :). I'll keep that in mind for my wish list, thanks again :-) Regards Allan URL: http://www.DIKU.dk/students/duff/ Man invented language to satisfy his deep need to complain. -- Lily Tomlin @ENDNODE @NODE "Mail_16" " off the topic. " From: Dr Brain Damage Date: 01-05-00 12:02:06 Subject: @{b}off the topic.@{ub} Just in case someone is interested, theres a new free e-mail service. It gives 6Mb of free space which is at least biggest one i have seen. Its also so new, that i was actually the first one to acquire e-mail address from there, just two hours ago. URL is http://planetlinks.8k.com - Dr.BrainDamage Angelfire for your free web-based e-mail. http://www.angelfire.com @ENDNODE @NODE "Mail_17" " Quick Q about Palette gads " From: Daithi O'Cuinn Date: 01-05-00 19:25:49 Subject: @{b}Quick Q about Palette gads@{ub} Hello, I am using a Palette gadtools gadget in my program, but I can't get the currently selected colour to stay depressed - it depresses when you click the mouse on it, and releases when you let go, and I don't want this, I want it to constantly show which colour is selected. I know it's bound to be just a flag I'm missing, but I can't think what Code is: ng.ng_TopEdge += ng.ng_Height + 5 + texty; ng.ng_Height = texty * 2; ng.ng_GadgetText = "Background"; ng.ng_Flags = PLACETEXT_ABOVE; ng.ng_GadgetID = BGCOLOUR; gad = CreateGadget(PALETTE_KIND, gad, &ng, GTPA_Depth, 4, GTPA_Color, background, TAG_DONE); Daithi O'Cuinn docuinn@cluke.demon.co.uk @ENDNODE @NODE "Mail_18" " Re: Quick Q about Palette gads " From: Laura Vance Date: 01-05-00 19:37:40 Subject: @{b}Re: Quick Q about Palette gads@{ub} Hello, I've never worked with a palette gadget in gadtools, but I do know that when I have programmed for the gadtools library, I had to be sure to only look for the mouseup which is the mouse button being released. The other thing that I had to do is set up a loop so that I only acted on the last IDCMP event that was passed to my program. But, as with your problem, before I made those changes, I would click a button, release the mouse button, and the button would activate again or deactivate, depending on how the button was set up. Hope that helps a little bit. On Wed, 05 Jan 2000, you wrote: > Hello, > I am using a Palette gadtools gadget in my program, but I can't get the > currently selected colour to stay depressed - it depresses when you click the > mouse on it, and releases when you let go, and I don't want this, I want it > to constantly show which colour is selected. I know it's bound to be just a > flag I'm missing, but I can't think what > Code is: > ng.ng_TopEdge += ng.ng_Height + 5 + texty; > ng.ng_Height = texty * 2; > ng.ng_GadgetText = "Background"; > ng.ng_Flags = PLACETEXT_ABOVE; > ng.ng_GadgetID = BGCOLOUR; > gad = CreateGadget(PALETTE_KIND, gad, &ng, > GTPA_Depth, 4, > GTPA_Color, background, > TAG_DONE); > TIA, > -- > Daithi O'Cuinn > docuinn@cluke.demon.co.uk > --------------------------- ONElist Sponsor ---------------------------- > Independent contractors: Find your next project gig through JobSwarm! > You can even make money by referring friends. > Click Here > ------------------------------------------------------------------------ > -> Spread the URL: http://www.onelist.com/subscribe/amiga-c <- > ======================================================================== > To UNSUBSCRIBE from this community, send an email to: > amiga-c-unsubscribe@onelist.com > and reply to the confirmation email we send you. > ======================================================================== Later, Laura \|/ (o O) ---oOO(_)OOo--- Peekaboo!!! @ENDNODE @NODE "Mail_19" " Problems with active object... " From: "Andrzej J. Debicki" Date: 01-06-00 08:09:55 Subject: @{b}Problems with active object...@{ub} Hello, I have a class (from Group) - MyClass. In the class I have some objects. One of them is Listview which has MUIA_CycleChain set to 1 (no other objects in CycleChain). Then I have MyWindow class (from Window). MyWindow consists two MyClass'es. Everything is OK when I cycle with TAB through my listviews. But when I click other object in MyClass or outside MyClass (some string object) the frame around listvieww disappears, active object changes to the other listview :-(. And sometimes active object changes to some other object :-(((. Whats going on? Is it MUI bug or I made an error? _ * Andrzej J. Debicki * A12ooT 34MB \\ _ * PANS - Polish Amiga News Squad * 6o3e/o6o \\// * denbi@friko3.onet.pl * BVisionPPC \/ * http://republika.pl/denbi * AmigaOS 3.5 ----------------------------------------------------------- @ENDNODE @NODE "Mail_20" " Re: Problems with active object... " From: Allan Odgaard Date: 01-06-00 12:29:42 Subject: @{b}Re: Problems with active object...@{ub} On 06-Jan-00, Andrzej J. Debicki wrote: > [...] click other object in MyClass or outside MyClass (some string object) > the frame around listvieww disappears, Clicking a stringgadget will always make it active. The same goes for textfields (like TextEditor.mcc) -- I think NList has some weird thing about going active or becoming 'default' when clicked, but you aren't using this, right? > active object changes to the other > listview :-(. And sometimes active object changes to some other object :-(((. > Whats going on? Is it MUI bug or I made an error? It's not a problem I've seen. If you send the sources then we can probably help you better. Btw: You do know about the MUI@OneList.com list, right? :-) Regards Allan URL: http://www.DIKU.dk/students/duff/ WinErr 43e: Modem driver corrupt. Download latest version any try again. @ENDNODE @NODE "Mail_21" " Windows " From: Steffen Date: 01-06-00 18:33:22 Subject: @{b}Windows@{ub} The following code works fine, printing 'word' across the window, but if i skip the window.Activate() (wich calls ActivateWindow();), i will receive no printing and the program eventually locks up, but the latter only occasionaly. I've come to the conclusion that the error occurs because the window is not physicly open, when i try to print to it, or receive messages (using WaitClose). Eventually, the activation of the window causes either a pause that allows intuition to 'really' open the window, or the call itself forces intuition to finish opening ? So OpenWindow() does not ensure the window is actually open, yes ? And if yes, is calling ActivateWindow() (or specifying WA_Activate in taglist); the 'right' way to solve the problem ? Thank you. void main() { int x; // OpenWindowTagList() is used to create a window for 'window' WinX window("Test_Window",0,0,640,512); // This Creates an IntuiText derived object IWord a_word("word"); // Prog doesn't work if this line is skipped // It calls ActivateWindow(); window.Activate(); // Print the text across the screen // Uses PrintIText(); for (x=0; x<256; x+=16) window.Print(a_word,x,x); window.WaitClose(); } @ENDNODE @NODE "Mail_22" " Re: Quick Q about Palette gads " From: Daithi O'Cuinn Date: 01-06-00 19:57:13 Subject: @{b}Re: Quick Q about Palette gads@{ub} Hello Laura On 05-Jan-00, Laura Vance wrote: > Hello, > I've never worked with a palette gadget in gadtools, but I do know that when > I have programmed for the gadtools library, I had to be sure to only look > for the mouseup which is the mouse button being released. I do only look for GadetUp... > But, as with your problem, before I made those changes, I would click a > button, release the mouse button, and the button would activate again or > deactivate, depending on how the button was set up. I think it is a simpler problem that this - I get events from the gadget fine, it's just that it does not permanently show the currently selected entry (ie the little 'paint pot' does not stay depressed). That's why I think it's something as simple as a flag. Though you have given me a clue - it could well be my IDCMP messages - I only ask for IDCMP_CLOSEWINDOW | IDCMP_GADGETUP Any one any ideas? Regards Daithi O'Cuinn docuinn@cluke.demon.co.uk @ENDNODE @NODE "Mail_23" " Re: Re: Quick Q about Palette gads " From: Gregory Roberts II Date: 01-06-00 20:49:27 Subject: @{b}Re: Re: Quick Q about Palette gads@{ub} On Thu, 6 Jan 2000, Daithi O'Cuinn wrote: > Hello Laura > I do only look for GadetUp... > I think it is a simpler problem that this - I get events from the gadget fine, > it's just that it does not permanently show the currently selected entry (ie > the little 'paint pot' does not stay depressed). > That's why I think it's something as simple as a flag. Though you have given > me a clue - it could well be my IDCMP messages - I only ask for > IDCMP_CLOSEWINDOW | IDCMP_GADGETUP > Any one any ideas? > Regards Are you using GetIMsg() to retrieve the messages? GadTools gadgets generate a lot of IDCMP events that you don't care about and are handled by the gadget. When you call GetIMsg() you get the "distilled" version of things. Also, I don't have the information right in front of me, but somewhere in the include files are defines for which types of IDCMP messages you should ask for when you set up the window. So, instead of specifically asking for IDCMP_GADGETUP, you'd ask for the IDCMP message for the palette gadget. If you need more clarification on this, just write and I'll dig up the info. BTW, if you want an example of using GadTools gadgets, I wrote a skeleton C application for a contest some time ago. You might still be able to find it on Aminet as Skeleton_C.lha, or from my (woefully outdated) website at http://www.en.com/users/gregr. I don't think I have a palette gadget in there, but I do use a number of different ones so you should be able to get the general idea. Good luck! gregr@en.com KC8BGC Amiga Enthusiast :) IBM programmer :( @ENDNODE @NODE "Mail_24" " The future of StormAmiga.lib!!! " From: Allan Odgaard Date: 01-06-00 20:52:31 Subject: @{b}The future of StormAmiga.lib!!!@{ub} Hi there, Since Matthias Henze (author of the StormAmiga.lib link library) only received two letters of endorsement, regarding the continued development of StormAmiga.lib, he naturally got a feeling that it wasn't worth continuing the project. However, before he terminates it then he's given us a chance to prove that we actually do want the library, so if you do use the library and want to see it developed further, please go visit the survey at: http://www.cyberdynesystems.de/Statement2_e.html Regards Allan URL: http://www.DIKU.dk/students/duff/ WinErr 43e: Modem driver corrupt. Download latest version any try again. @ENDNODE @NODE "Mail_25" " Re: Re: Quick Q about Palette gads " From: David McMinn Date: 01-06-00 20:54:03 Subject: @{b}Re: Re: Quick Q about Palette gads@{ub} Hi Daithi > gadget fine, it's just that it does not permanently show the > currently selected entry (ie the little 'paint pot' does not stay > depressed). That's why I think it's something as simple as a flag. I didn't read the original post you sent, but have you tried #GTPA_IndicatorWidth and/or #GTPA_IndicatorHeight set to the width/height of the border to put round the colour, when you are creating the gadget? |) /\ \/ ][ |) |\/| |\/| ][ |\| |\| | dave@satanicdreams.com http://members.xoom.com/David_McMinn | ICQ=16827694 A crab in the hand is worth two in the bush. @ENDNODE @NODE "Mail_26" " Tasks " From: Andrew Bell Date: 01-06-00 21:10:45 Subject: @{b}Tasks@{ub} Hi all, Is this there a system friendly way of determining if a task pointer is still valid, without having to traverse the execbase lists? Regards, Andrew Bell. +----------------------------------------+ email: mailto:andrew.ab2000@bigfoot.com or mailto:andrew@ab2000.prestel.co.uk web: http://www2.prestel.co.uk/ab2000 +----------------------------------------+ Spock.SpockSpockTransmit now. * Kirk @ENDNODE @NODE "Mail_27" " Re: Tasks " From: Laura Vance Date: 01-06-00 23:47:47 Subject: @{b}Re: Tasks@{ub} On Thu, 06 Jan 2000, you wrote: > Hi all, > Is this there a system friendly way of determining if a task pointer > is still valid, without having to traverse the execbase lists? > Regards, Andrew Bell. I'm not sure exactly what you need it for, but I have a method to check if a copy of my program is already running by using the "FindTask()" function. This is only good if you just want to find out if the task is running. I'm not sure how to find out how many copies are running, but if that's what you need, then I'm sure someone else can explain it to both of us. Excerpt from page 85 of "Mapping the Amiga" FindTask Description: finds a task by name, or finds oneself Library: exec.library Offset: -$126 Syntax: task = FindTask(name) C: struct Task *FindTask(STRPTR) ML: d0 = FindTask(a1) Arguments: name = name of the task to find; 0 to find oneself Result: task = the task (or process) matching the name; zero if unsuccessful Later, Laura \|/ (o O) ---oOO(_)OOo--- Peekaboo!!! @ENDNODE @NODE "Mail_28" " Re: Tasks " From: Andrew Bell Date: 01-07-00 01:37:49 Subject: @{b}Re: Tasks@{ub} Hi Laura, On 06-Jan-00 you wrote: Re: [amiga-c] Tasks >> Is this there a system friendly way of determining if a task >> pointer is still valid, without having to traverse the execbase >> lists? > I'm not sure exactly what you need it for, but I have a method to > check if a copy of my program is already running by using the > "FindTask()" function. I've already considered FindTask(), but it's not what I'm looking for. The main reason being - tasks names are not unique. A call to FindTask() only returns the first matching task pointer with that name. I'm writing a resource tracker (it's a personal debugging tool, much like SnoopDOS, but tracks resources through their allocated life-time) and I want to be able to store a task pointer, then check later to see if that same task is still running. Because task names are not unique, FindTask() isn't the best solution. Task pointers are the ideal solution. An exec function called IsTaskPtrValid() would have kept me happy. :-) > This is only good if you just want to find out if the task is > running. I'm not sure how to find out how many copies are running, > but if that's what you need, then I'm sure someone else can explain > it to both of us. The only way I can think of doing this, is to peek into execbase's task lists. This method isn't really system friendly since the exec lists are marked private. > Excerpt from page 85 of "Mapping the Amiga" > [snip] Thanks for your reply. Regards, Andrew Bell. +----------------------------------------+ email: mailto:andrew.ab2000@bigfoot.com or mailto:andrew@ab2000.prestel.co.uk web: http://www2.prestel.co.uk/ab2000 +----------------------------------------+ That should clear out your sinuses. @ENDNODE @NODE "Mail_29" " Re: Re: Tasks " From: Duane McDonnell Date: 01-07-00 08:40:36 Subject: @{b}Re: Re: Tasks@{ub} >>> Is this there a system friendly way of determining if a task >>> pointer is still valid, without having to traverse the execbase >>> lists? >> I'm not sure exactly what you need it for, but I have a method to >> check if a copy of my program is already running by using the >> "FindTask()" function. >I've already considered FindTask(), but it's not what I'm looking for. >The main reason being - tasks names are not unique. A call to >FindTask() only returns the first matching task pointer with that >name. >I'm writing a resource tracker (it's a personal debugging tool, much >like SnoopDOS, but tracks resources through their allocated >life-time) and I want to be able to store a task pointer, then check >later to see if that same task is still running. Because task names >are not unique, FindTask() isn't the best solution. Task pointers are >the ideal solution. An exec function called IsTaskPtrValid() would >have kept me happy. :-) You'll have to traverse Exec's task list as quickly as possible between a Forbid/Permit pair. I have a function I wrote in assembly to do this, it is my implementation of IsTaskPtrValid(). I've been using it for years with no problems so I know that it's stable. I'll be happy to assemble the function as an object and provide you with a SAS/C calling prototype. >> This is only good if you just want to find out if the task is >> running. I'm not sure how to find out how many copies are running, >> but if that's what you need, then I'm sure someone else can explain >> it to both of us. >The only way I can think of doing this, is to peek into execbase's >task lists. This method isn't really system friendly since the exec >lists are marked private. You can't avoid this, you have to peek Exec's lists. Although they're marked private, *lots* of software does this. Provided you disable multi-tasking during list traversal (some people even use a Disable/Enable to be extra safe, but that's not really necessary) you're taking all the precautions you possibly can. This is one of those few cases where you need to toss the guidelines out the window because it's impossible to do it any other way. It may interest you to know that Carl Sassenrath released example code which did this too, so C= clearly intended this to be an exception to the rule. @ENDNODE @NODE "Mail_30" " Re: Re: Problems with active object... " From: "Andrzej J. Debicki" Date: 01-07-00 09:03:09 Subject: @{b}Re: Re: Problems with active object...@{ub} Hello Allan, Thursday, January 06, 2000, you wrote: > Clicking a stringgadget will always make it active. The same goes for > textfields (like TextEditor.mcc) -- I think NList has some weird thing about > going active or becoming 'default' when clicked, but you aren't using this, > right? Im using generic Listview object from MUI. > It's not a problem I've seen. If you send the sources then we can probably > help you better. This is MyClass: obj = (Object*)DoSuperNew(cl, obj, MUIA_Group_Horiz, FALSE, Child, VGroup, Child, HGroup, Child, popVolume = PopobjectObject, ... MUIA_Popobject_Object, lstPopVolume = ListviewObject, ... End, /* ListviewObject */ End, /*PopobjectObject */ End, /* HGroup */ Child, lstDirList = ListviewObject, MUIA_CycleChain, 1, MUIA_Listview_MultiSelect, MUIV_Listview_MultiSelect_Default, MUIA_Listview_List, DirlistObject, ... End, /* DirListObject */ End, /* ListviewObject */ TAG_MORE, msg->ops_AttrList); This is MainWnd: obj = (Object*)DoSuperNew(cl, obj, ... WindowContents, VGroup, Child, HGroup, Child, PanelL = NewObject(CCPanel->mcc_Class, NULL, TAG_DONE), Child, BalanceObject, End, Child, PanelR = NewObject(CCPanel->mcc_Class, NULL, TAG_DONE), End, /* HGroup */ Child, ColGroup(2), Child, Label("CLI Command:"), Child, strCommand = String("", 100), End, /* ColGroup */ Child, HGroup, MUIA_Group_Spacing, 0, Child, btn1 = SimpleButton("Help"), Child, btn2 = SimpleButton("F2"), ... End, /* HGroup */ End, /* VGroup */ TAG_MORE, msg->ops_AttrList); I need to perform some action when btn1 or btn2 is pressed. Data for the action is taken from active list view. But what to do when user click string object or popobject and then the button? > Btw: You do know about the MUI@OneList.com list, right? :-) Ooopppsss... i forgot... :-) I sent the question to MUI on aachen.de but received no answer. _ * Andrzej J. Debicki * A12ooT 34MB \\ _ * PANS - Polish Amiga News Squad * 6o3e/o6o \\// * denbi@friko3.onet.pl * BVisionPPC \/ * http://republika.pl/denbi * AmigaOS 3.5 ----------------------------------------------------------- @ENDNODE @NODE "Mail_31" " Re: Re: Tasks " From: Duane McDonnell Date: 01-07-00 09:05:23 Subject: @{b}Re: Re: Tasks@{ub} >I'm writing a resource tracker (it's a personal debugging tool, much >like SnoopDOS, but tracks resources through their allocated >life-time) and I want to be able to store a task pointer, then check >later to see if that same task is still running. Because task names >are not unique, FindTask() isn't the best solution. Task pointers are >the ideal solution. An exec function called IsTaskPtrValid() would >have kept me happy. :-) One final thing I forgot to mention, IsTaskPtrValid() is not by itself suitable for checking if a task which was known to be running at some time in the past is still running now, because it does not account for the possibility that a task was removed and a subsequent task was added at the same memory location. To solve this, you also need to account for the task name. To get a valid match, you need to match both the task name string (or hash key if you prefer) *and* the task address. @ENDNODE @NODE "Mail_32" " Re: Re: Tasks " From: Nicholas Clarke Date: 01-07-00 09:15:24 Subject: @{b}Re: Re: Tasks@{ub} On Fri, 7 Jan 2000, Duane McDonnell wrote: > One final thing I forgot to mention, IsTaskPtrValid() is not > by itself suitable for checking if a task which was known to be > running at some time in the past is still running now, because > it does not account for the possibility that a task was removed > and a subsequent task was added at the same memory location. > To solve this, you also need to account for the task name. To > get a valid match, you need to match both the task name string > (or hash key if you prefer) *and* the task address. Exec uses unique identifiers for each task. Wether they work is another matter. @ENDNODE @NODE "Mail_33" " Re: Re: Tasks " From: Duane McDonnell Date: 01-07-00 11:33:34 Subject: @{b}Re: Re: Tasks@{ub} >On Fri, 7 Jan 2000, Duane McDonnell wrote: >> One final thing I forgot to mention, IsTaskPtrValid() is not >> by itself suitable for checking if a task which was known to be >> running at some time in the past is still running now, because >> it does not account for the possibility that a task was removed >> and a subsequent task was added at the same memory location. >> To solve this, you also need to account for the task name. To >> get a valid match, you need to match both the task name string >> (or hash key if you prefer) *and* the task address. >Exec uses unique identifiers for each task. Wether they work is another >matter. Where's the task ID stored? I can't see it in the Task structure. @ENDNODE @NODE "Mail_34" " Re: Tasks " From: Andrew Bell Date: 01-07-00 13:53:25 Subject: @{b}Re: Tasks@{ub} Hi Duane, On 07-Jan-00 you wrote: Re: [amiga-c] Re: Tasks >> I'm writing a resource tracker (it's a personal debugging tool, >> much like SnoopDOS, but tracks resources through their allocated >> life-time) and I want to be able to store a task pointer, then >> check later to see if that same task is still running. Because task >> names are not unique, FindTask() isn't the best solution. Task >> pointers are the ideal solution. An exec function called >> IsTaskPtrValid() would have kept me happy. :-) > One final thing I forgot to mention, IsTaskPtrValid() is not > by itself suitable for checking if a task which was known to be > running at some time in the past is still running now, because > it does not account for the possibility that a task was removed > and a subsequent task was added at the same memory location. I know what you mean, I considered this myself. If a task is freed then another one is created right after it, they *might* just share the same task pointer. > To solve this, you also need to account for the task name. To > get a valid match, you need to match both the task name string > (or hash key if you prefer) *and* the task address. I'm already doing this, of course this wouldn't work 100% if a task decided to modify it's ln_Name field. But it's probably the best solution I have atm, even if it's a little hacky. In your other post, you mentioned that Carl Sassenrath released some example code, is this code on the Developer CD, do you know? Thanks for your help. Regards, Andrew Bell. +----------------------------------------+ email: mailto:andrew.ab2000@bigfoot.com or mailto:andrew@ab2000.prestel.co.uk web: http://www2.prestel.co.uk/ab2000 +----------------------------------------+ My cat just loves to play Hide-And-Go-Puke! @ENDNODE @NODE "Mail_35" " Re: Quick Q about Palette gads " From: Bob Lanham Date: 01-07-00 14:17:37 Subject: @{b}Re: Quick Q about Palette gads@{ub} > On Thu, 6 Jan 2000, Daithi O'Cuinn wrote: > > I do only look for GadetUp... > > I think it is a simpler problem that this - I get events from the gadget fine, > > it's just that it does not permanently show the currently selected entry (ie > > the little 'paint pot' does not stay depressed). > > That's why I think it's something as simple as a flag. Though you have given > > me a clue - it could well be my IDCMP messages - I only ask for > > IDCMP_CLOSEWINDOW | IDCMP_GADGETUP > > Any one any ideas? > > Regards There is a good example of how to program the gadtools palette on Aminet. I tried it, and the paint buttons stay down when clicked. Search for GadgetTest.lha. http://de.aminet.net/aminetbin/find?gadgettest @ENDNODE @NODE "Mail_36" " Re: Tasks " From: Duane McDonnell Date: 01-07-00 16:02:44 Subject: @{b}Re: Tasks@{ub} On Thu, 06-Jan-00, Laura Vance wrote: >Excerpt from page 85 of "Mapping the Amiga" >FindTask >Description:finds a task by name, or finds oneself >Library:exec.library >Offset:-$126 >Syntax:task = FindTask(name) >C:struct Task *FindTask(STRPTR) >ML:d0 = FindTask(a1) >Arguments:name = name of the task to find; 0 to find oneself >Result:task = the task (or process) matching the name; zero if >unsuccessful Be careful using this book, it's littered with errors (eg: Move(), ReadPixel(), RectFill(), Signal() and some of the structure definitions). Use the AutoDocs if possible. @ENDNODE @NODE "Mail_37" " Re: Windows " From: Tak Tang Date: 01-07-00 17:33:33 Subject: @{b}Re: Windows@{ub} OpenWindow() and OpenWindowTagList() DO open the window on return. There are options which can make the window active or inactive when it opens, but you should be able to print intuitext to it immediately. It might be a bug in your window class. Tak Tang Let the good times roll. >>> Steffen 06/01/2000 17:33:22 >>> The following code works fine, printing 'word' across the window, but if i skip the window.Activate() (wich calls ActivateWindow();), i will receive no printing and the program eventually locks up, but the latter only occasionaly. I've come to the conclusion that the error occurs because the window is not physicly open, when i try to print to it, or receive messages (using WaitClose). Eventually, the activation of the window causes either a pause that allows intuition to 'really' open the window, or the call itself forces intuition to finish opening ? So OpenWindow() does not ensure the window is actually open, yes ? And if yes, is calling ActivateWindow() (or specifying WA_Activate in taglist); the 'right' way to solve the problem ? Thank you. void main() { int x; // OpenWindowTagList() is used to create a window for 'window' WinX window("Test_Window",0,0,640,512); // This Creates an IntuiText derived object IWord a_word("word"); // Prog doesn't work if this line is skipped // It calls ActivateWindow(); window.Activate(); // Print the text across the screen // Uses PrintIText(); for (x=0; x<256; x+=16) window.Print(a_word,x,x); window.WaitClose(); } @ENDNODE @NODE "Mail_38" " Re: Re: Tasks " From: Duane McDonnell Date: 01-07-00 18:34:09 Subject: @{b}Re: Re: Tasks@{ub} >> To solve this, you also need to account for the task name. To >> get a valid match, you need to match both the task name string >> (or hash key if you prefer) *and* the task address. >I'm already doing this, of course this wouldn't work 100% if a task >decided to modify it's ln_Name field. But it's probably the best >solution I have atm, even if it's a little hacky. It is a bit of hack but that's unavoidable really since I'm pretty sure Exec doesn't support task identification (someone else said that it did, I could be wrong). Even with checking both the name and address there is still the remote possibility that you'll get an incorrect detection. A full solution would probably involve patching AddTask() and RemTask() to build your own task identification list (you'd have to check that DOS functions like CreateProc() and CreateNewProc() were being intercepted too, it's possible they might not call the public Exec interface in all ROM versions). Doing all this is almost certainly overkill however, the chances of a bad detection using your current solution would be extremely remote. >In your other post, you mentioned that Carl Sassenrath released some >example code, is this code on the Developer CD, do you know? This is going back a long time so I'm not certain where I saw this, however it may have been in his Guru's Guide book. I no longer have a copy but I think the code is on Aminet. The source to any "who" or "ps" type program will also be good examples. If you can understand asm the source to Xoper may be worth a look too. @ENDNODE @NODE "Mail_39" " Re: Quick Q about Palette gads " From: Daithi O'Cuinn Date: 01-07-00 21:25:18 Subject: @{b}Re: Quick Q about Palette gads@{ub} Hello Bob On 07-Jan-00, Bob Lanham wrote: > There is a good example of how to program the gadtools palette on > Aminet. I tried it, and the paint buttons stay down when clicked. > Search for GadgetTest.lha. Thanks, Bob, and to all else who replied. What I needed was indeed the GTPA_IndicatorWidth tag. Oddly, though, it doesn't matter whether I set it to 1 or 100, it still does the same thing visually. This doesn't matter, but I am sort of wondering what on Earth the point of this tag is... Regards Daithi O'Cuinn docuinn@cluke.demon.co.uk @ENDNODE @NODE "Mail_40" " Re: Windows " From: Laura Vance Date: 01-07-00 23:24:57 Subject: @{b}Re: Windows@{ub} On Thu, 06 Jan 2000, you wrote: > The following code works fine, printing 'word' across the window, but if i skip the window.Activate() (wich calls ActivateWindow();), i will receive no printing and the program eventually locks up, but the latter only occasionaly. I've come to the conclusion that the error occurs because the window is not physicly open, when i try to print to it, or receive messages (using WaitClose). Eventually, the activation of the window causes either a pause that allows intuition to 'really' open the window, or the call itself forces intuition to finish opening ? > So OpenWindow() does not ensure the window is actually open, yes ? > And if yes, is calling ActivateWindow() (or specifying WA_Activate in taglist); the 'right' way to solve the problem ? > Thank you. It might help if you showed the class instead of the code, because this looks like c++, and if you've defined your class right, then there shouldn't be a problem with your code. Later, Laura \|/ (o O) ---oOO(_)OOo--- Peekaboo!!! @ENDNODE @NODE "Mail_41" " Re: Tasks " From: Laura Vance Date: 01-07-00 23:33:27 Subject: @{b}Re: Tasks@{ub} On Fri, 07 Jan 2000, you wrote: > On Thu, 06-Jan-00, Laura Vance wrote: > >Excerpt from page 85 of "Mapping the Amiga" > >FindTask > >Description:finds a task by name, or finds oneself > >Library:exec.library > >Offset:-$126 > >Syntax:task = FindTask(name) > >C:struct Task *FindTask(STRPTR) > >ML:d0 = FindTask(a1) > >Arguments:name = name of the task to find; 0 to find oneself > >Result:task = the task (or process) matching the name; zero if > >unsuccessful > Be careful using this book, it's littered with errors (eg: Move(), > ReadPixel(), RectFill(), Signal() and some of the structure > definitions). Use the AutoDocs if possible. That's funny, I've never had any problems with those functions when I used them from that book. The only one that I haven't used that you listed is Signal(). But I do always use more than one reference, because I've seen too many of them that have problems. Later, Laura \|/ (o O) ---oOO(_)OOo--- Peekaboo!!! @ENDNODE @NODE "Mail_42" " Re: Re: Tasks " From: Nicholas Clarke Date: 01-07-00 23:44:28 Subject: @{b}Re: Re: Tasks@{ub} On Fri, 7 Jan 2000, Duane McDonnell wrote: > >On Fri, 7 Jan 2000, Duane McDonnell wrote: > >> One final thing I forgot to mention, IsTaskPtrValid() is not > >> by itself suitable for checking if a task which was known to be > >> running at some time in the past is still running now, because > >> it does not account for the possibility that a task was removed > >> and a subsequent task was added at the same memory location. > >> > >> To solve this, you also need to account for the task name. To > >> get a valid match, you need to match both the task name string > >> (or hash key if you prefer) *and* the task address. > >Exec uses unique identifiers for each task. Wether they work is another > >matter. > Where's the task ID stored? I can't see it in the Task structure. Well I see you need the asm includes. Since they are more upto date. ;* Pointer to an extended task structure. This structure is allocated ;* by V36 Exec if the proper flags in tc_ETaskFlags are set. This ;* field was formerly defined as: ;* UWORD TC_TRAPALLOC ; traps allocated ;* UWORD TC_TRAPABLE ; traps enabled ;* Please see the Exec AllocTrap() and FreeTrap() calls. ;Don't even _think_ about allocating one of these yourself. STRUCTURE ETask,MN_SIZE APTR et_Parent ;Pointer to task (TC) ULONG et_UniqueID ;ID unique to this task STRUCT et_Children,MLH_SIZE ;List of children UWORD et_TRAPALLOC UWORD et_TRAPABLE ULONG et_Result1 ;First result APTR et_Result2 ;Result data pointer (AllocVec) STRUCT et_TaskMsgPort,MP_SIZE LABEL ETask_SIZEOF ;_never_ depend on this size! But I now see it depends on a flag. @ENDNODE @NODE "Mail_43" " Re: Windows " From: Steffen Date: 01-08-00 05:42:53 Subject: @{b}Re: Windows@{ub} From: Steffen I forgot to call the function that resets the IntuiText structure, when creating an IWord from a char* !!! The funny thing is the program didn't work, until i inserted the Activate, and when i removed the line, it stoped working. It was merely a strange coincident. Thanx still... On 08-Jan-00, Laura Vance wrote: > On Thu, 06 Jan 2000, you wrote: >> The following code works fine, printing 'word' across the window, but if i skip the window.Activate() (wich calls ActivateWindow();), i will receive no printing and the program eventually locks up, but the latter only occasionaly. I've come to the conclusion that the error occurs because the window is not physicly open, when i try to print to it, or receive messages (using WaitClose). Eventually, the activation of the window causes either a pause that allows intuition to 'really' open the window, or the call itself forces intuition to finish opening ? >> So OpenWindow() does not ensure the window is actually open, yes ? >> And if yes, is calling ActivateWindow() (or specifying WA_Activate in taglist); the 'right' way to solve the problem ? >> Thank you. > It might help if you showed the class instead of the code, because this looks > like c++, and if you've defined your class right, then there shouldn't be a > problem with your code. > -- > Later, > Laura @ENDNODE @NODE "Mail_44" " Re: Windows " From: Steffen Date: 01-08-00 05:44:30 Subject: @{b}Re: Windows@{ub} From: Steffen Not window class, but IWord class (see other mail). Thanx still... On 07-Jan-00, Tak Tang wrote: > OpenWindow() and OpenWindowTagList() DO open the window on return. There are options which can make the window active or inactive when it opens, but you should be able to print intuitext to it immediately. It might be a bug in your window class. > Tak Tang > Let the good times roll. >>>> Steffen 06/01/2000 17:33:22 >>> > The following code works fine, printing 'word' across the window, but if i skip the window.Activate() (wich calls ActivateWindow();), i will receive no printing and the program eventually locks up, but the latter only occasionaly. I've come to the conclusion that the error occurs because the window is not physicly open, when i try to print to it, or receive messages (using WaitClose). Eventually, the activation of the window causes either a pause that allows intuition to 'really' open the window, or the call itself forces intuition to finish opening ? > So OpenWindow() does not ensure the window is actually open, yes ? > And if yes, is calling ActivateWindow() (or specifying WA_Activate in taglist); the 'right' way to solve the problem ? > Thank you. > void main() > { > int x; > // OpenWindowTagList() is used to create a window for 'window' > WinX window("Test_Window",0,0,640,512); > // This Creates an IntuiText derived object > IWord a_word("word"); > > // Prog doesn't work if this line is skipped > // It calls ActivateWindow(); > window.Activate(); > // Print the text across the screen > // Uses PrintIText(); > for (x=0; x<256; x+=16) window.Print(a_word,x,x); > > window.WaitClose(); > } > --------------------------- ONElist Sponsor ---------------------------- > Hey Freelancers: Find your next project through JobSwarm! > You can even make money in your sleep by referring friends. > Click Here > ------------------------------------------------------------------------ > -> Spread the URL: http://www.onelist.com/subscribe/amiga-c <- > ********************************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > This footnote also confirms that this email message has been swept by > MIMEsweeper for the presence of computer viruses. > ********************************************************************** > --------------------------- ONElist Sponsor ---------------------------- > Hey Freelancers: Find your next project through JobSwarm! > You can even make money in your sleep by referring friends. > Click Here > ------------------------------------------------------------------------ > -> Spread the URL: http://www.onelist.com/subscribe/amiga-c <- Regards @ENDNODE @NODE "Mail_45" " Re: Tasks " From: Duane McDonnell Date: 01-08-00 10:09:10 Subject: @{b}Re: Tasks@{ub} From: Duane McDonnell >On Fri, 07 Jan 2000, you wrote: >> On Thu, 06-Jan-00, Laura Vance wrote: >> >Excerpt from page 85 of "Mapping the Amiga" >> >FindTask >> >Description:finds a task by name, or finds oneself >> >Library:exec.library >> >Offset:-$126 >> >Syntax:task = FindTask(name) >> >C:struct Task *FindTask(STRPTR) >> >ML:d0 = FindTask(a1) >> >Arguments:name = name of the task to find; 0 to find oneself >> >Result:task = the task (or process) matching the name; zero if >> >unsuccessful >> Be careful using this book, it's littered with errors (eg: Move(), >> ReadPixel(), RectFill(), Signal() and some of the structure >> definitions). Use the AutoDocs if possible. >That's funny, I've never had any problems with those functions when I used >them >from that book. The only one that I haven't used that you listed is Signal(). Compare the input registers for those functions with the ones listed in the AutoDocs. If you're programming in C your prototypes/pragmas will hide these errors, but if you do any assembly work the many instances of incorrect registers will cause problems (if you're lucky you'll get an immediate crash, otherwise the bug will lurk in your code). @ENDNODE @NODE "Mail_46" " Re: Re: Tasks " From: Duane McDonnell Date: 01-08-00 10:13:56 Subject: @{b}Re: Re: Tasks@{ub} From: Duane McDonnell >> >Exec uses unique identifiers for each task. Wether they work is another >> >matter. >> Where's the task ID stored? I can't see it in the Task structure. >Well I see you need the asm includes. Since they are more upto date. Indeed, I checked the C includes. [extended struct] >But I now see it depends on a flag. It would still be useful to compares IDs if they are available. Thanks for pointing it out. @ENDNODE @NODE "Mail_47" " List Newbie + VBCC/BOOPSI questions " From: "Sealey, M." Date: 01-10-00 11:41:52 Subject: @{b}List Newbie + VBCC/BOOPSI questions@{ub} From: "Sealey, M." Hello! I'm new here, and I'd like to get my first mail off to a flying start by asking some REALLY nasty questions: Are there any special considerations I need to make to create BOOPSI classes in VBCC? I'm currently writing some, but none of them will work in class form due to some nasty gurus in 'ramlib' (it's not a stack problem in ramlib :) or in the task using the classes itself. I'm using a modified CLib37x to compile it all, and as far as I can tell the code is absolutely fine (I only get one warning, and it's a harmless :) but I must be doing something wrong somewhere. So before I start throwing code around, I'm just wondering if there are any special options I need to specify to VBCC to make BOOPSI classes, or compiler specific defines, etc.. (if you really want to know, I'm re-doing the Reaction glyph.image to create a more pleasing XEN-style look and add support for VisualPrefs' through an internal API.. eventually ;) Any help would be appreciated! Matt Sealey mws2@le.ac.uk Distributed Systems Support Computer Centre University of Leicester @ENDNODE @NODE "Mail_48" " Re: Tasks " From: Allan Odgaard Date: 01-12-00 04:07:36 Subject: @{b}Re: Tasks@{ub} From: Allan Odgaard On 07-Jan-00, Andrew Bell wrote: >> One final thing I forgot to mention, IsTaskPtrValid() is not >> by itself suitable for checking if a task which was known to be >> running at some time in the past is still running now [...] > I know what you mean, I considered this myself. If a task is freed > then another one is created right after it, they *might* just share > the same task pointer. In some contexts they are very likely to share the same address. E.g. if a program periodically launches a sub-process to handle some calculations then it's likely to get the same address if the rest of the system is 'resting'. Regards Allan URL: http://www.DIKU.dk/students/duff/ WinErr 43e: Modem driver corrupt. Download latest version any try again. @ENDNODE @NODE "Mail_49" " Compiling for PPC " From: Kim Sindalsen Date: 01-13-00 13:24:24 Subject: @{b}Compiling for PPC@{ub} From: =?iso-8859-1?q?Kim=20Sindalsen?= This message wasn't meant to be posted here, but I've suffered a HD-loss and means that many e-mails+addresses has been lost, too..... This message was originally intended for Raimund.... Now I've got cc1-exe and ixemul.library for PPC, next step is to configure gcc (egcs) with --target=ppc-amigaos, right ?? I asume that this means I have to d/l the egcs-source, configure and then make it....... On the CD from phase5 supplied with my PPC-card I found some GCC-includes. I've also found a lib-file from Rask Ingemann Lambertsen, should/could I use this ??? Regards, Kim. ______________________________________________________ Do You Yahoo!? en gratis @yahoo.dk-adresse p http://mail.yahoo.dk @ENDNODE @NODE "Mail_50" " Re: Tasks " From: Ilkka Lehtoranta Date: 01-13-00 13:30:57 Subject: @{b}Re: Tasks@{ub} From: Ilkka Lehtoranta Hello Nicholas On 08-Tam-00, you wrote: NC>> Exec uses unique identifiers for each task. Wether they work is NC>> another matter. NC>> NC>> Where's the task ID stored? I can't see it in the Task structure. NC> Well I see you need the asm includes. Since they are more upto date. In addition, if you are using ASM includes from Developer CD 2.1 you have to edit some files because they contain some errors... @ENDNODE @NODE "Mail_51" " Re: Tasks " From: Tak Tang Date: 01-13-00 15:21:28 Subject: @{b}Re: Tasks@{ub} From: "Tak Tang" You could also look at the segment list. SegTracker (comes with mungwall or enforcer) might do some of what you are looking for. Tak Tang Let the good times roll. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. ********************************************************************** @ENDNODE @NODE "Mail_52" " Re: Re: Tasks " From: Olaf Barthel Date: 01-13-00 16:12:03 Subject: @{b}Re: Re: Tasks@{ub} From: "Olaf Barthel" On Jan 13 Ilkka (Ilkka Lehtoranta) wrote: > From: Ilkka Lehtoranta > Hello Nicholas > On 08-Tam-00, you wrote: > NC>> Exec uses unique identifiers for each task. Wether they work is > NC>> another matter. > NC>> > NC>> Where's the task ID stored? I can't see it in the Task structure. > NC> > NC> Well I see you need the asm includes. Since they are more upto date. > In addition, if you are using ASM includes from Developer CD 2.1 you > have to edit some files because they contain some errors... Such as? I'd like to get them fixed, if possible. Home: Olaf Barthel, Brabeckstrasse 35, D-30559 Hannover Net: olsen@sourcery.han.de (Home), olsen@logicalline.com (Work) @ENDNODE @NODE "Mail_53" " a2ixlibrary " From: Joar Sivertsen Date: 01-13-00 18:23:21 Subject: @{b}a2ixlibrary@{ub} From: Joar Sivertsen I'm having some troubles with .ixlibraries.. I've built the .a lib, which works just fine, then I ran a2ixlibrary to make the .ixlibrary, but when an app tries to use the .ixlibrary, it (the app) just crashes with a bus error :( Anyone know why, or have any docs for a2ixlibrary, cos I couldnt find any.. @ENDNODE @NODE "Mail_54" " pure programs " From: Linus McCabe Date: 01-13-00 22:06:52 Subject: @{b}pure programs@{ub} From: Linus McCabe I recently had to reinstall my entire system after a hdcrash. At first everything (well, almost) worked fine but all of a sudden 'assign' wasnt working properly anymore. If I tried to make an 'assign xxx: dismount' nothing would happen; if I tried to make an 'assign mui:libs/ add' the specified directory would not be added to the libs: assign, but instead would the 'LIBS:' assign be renamed to '.IBS:'. Wierdest thing. After a while I noticed that if I used c:assign instead of just 'assign' everything worked, and I then took away the 'resident assign pure' from the startup-sequence. Now it all works. Now to my question. Did all this happen because assign is not really a pure program, or what else could it be? If a program is not pure, will it still work as a resident program if its only run once at a time, or does that not matter? and why did it work before? /Linus Linus McCabe * Sparkle@hehe.com * Sparkle, #Amiga, DalNet * http://sparkle.amiga.tm No one will believe it's the blues if you wear a suit, unless you happen to be an old black man. @ENDNODE @NODE "Mail_55" " Re: a2ixlibrary " From: Joar Sivertsen Date: 01-13-00 22:18:54 Subject: @{b}Re: a2ixlibrary@{ub} From: Joar Sivertsen Hi Joar On 13-Jan-00, you wrote: > I'm having some troubles with .ixlibraries.. > I've built the .a lib, which works just fine, then I ran a2ixlibrary to > make the .ixlibrary, but when an app tries to use the .ixlibrary, it (the > app) just crashes with a bus error :( > Anyone know why, or have any docs for a2ixlibrary, cos I couldnt find > any.. Bah, never mind, found the docs ;) Bit silly to only include them in the source archive, but oh well.. @ENDNODE @NODE "Mail_56" " Re: Tasks " From: Andrew Bell Date: 01-14-00 00:29:47 Subject: @{b}Re: Tasks@{ub} From: Andrew Bell Hi Allan, On 12-Jan-00 you wrote: [amiga-c] Re: Tasks >>> One final thing I forgot to mention, IsTaskPtrValid() is not >>> by itself suitable for checking if a task which was known to be >>> running at some time in the past is still running now [...] >> I know what you mean, I considered this myself. If a task is freed >> then another one is created right after it, they *might* just share >> the same task pointer. > In some contexts they are very likely to share the same address. > E.g. if a program periodically launches a sub-process to handle some > calculations then it's likely to get the same address if the rest of > the system is 'resting'. I'll probably just write a patch for AddTask()/RemTask() that'll ensure no two tasks will ever share the same task pointer, while my program is running. :-) Regards, Andrew Bell. +----------------------------------------+ email: mailto:andrew.ab2000@bigfoot.com or mailto:andrew@ab2000.prestel.co.uk web: http://www2.prestel.co.uk/ab2000 +----------------------------------------+ I am Locutus of Borg: The color of your Poupon is irrelevant. @ENDNODE @NODE "Mail_57" " Re: Tasks " From: Andrew Bell Date: 01-14-00 00:53:49 Subject: @{b}Re: Tasks@{ub} From: Andrew Bell Hi Tak, On 13-Jan-00 you wrote: [amiga-c] Re: Tasks > You could also look at the segment list. SegTracker (comes with > mungwall or enforcer) might do some of what you are looking for. This only works if the process has a CLI structure (i.e. not started from WB), even then, a Shell Process can have many segment lists attached to it during it's life time (not at the same time though). Plus the fact that some programs like to dettach themselves from CLI by spawning a new process with the existing segment list and clearing their cli_Module field before exiting the old process. So the segment list wouldn't be a solid form of task identification. Thanks for your suggestion anyway. Regards, Andrew Bell. +----------------------------------------+ email: mailto:andrew.ab2000@bigfoot.com or mailto:andrew@ab2000.prestel.co.uk web: http://www2.prestel.co.uk/ab2000 +----------------------------------------+ DS9 meets Moonbase Alpha: Odo + Maya = Love at first ooze. @ENDNODE @NODE "Mail_58" " Re: pure programs " From: Linus McCabe Date: 01-14-00 19:13:31 Subject: @{b}Re: pure programs@{ub} From: Linus McCabe Hello Duane > Sounds like you lost the "P" attribute during the re-install. OK, so specifying the p flag indicates that the program is not reerntrant? it doesent even matter that much, i dont need it residen.. But thansk for the info! /linus > Check that C:Assign has the "P" attribute set. It should be set. > Use "Protect C:Assign +P" to set it. If Assign's flags are > incorrect you might want to assume that other commands are > also incorrect. When copying, you generally want to clone > the file exactly, however many copy programs don't do this > by default and some don't allow it all. > --------------------------- ONElist Sponsor > ---------------------------- > Hey Freelancers: Find your next project through JobSwarm! > You can even make money in your sleep by referring friends. > Click Here ------------------------------------------------------------------------ > -> Spread the URL: http://www.onelist.com/subscribe/amiga-c <- Linus McCabe * Sparkle@hehe.com * Sparkle, #Amiga, DalNet * http://sparkle.amiga.tm @ENDNODE @NODE "Mail_59" " Re: Tasks " From: Ilkka Lehtoranta Date: 01-14-00 22:13:09 Subject: @{b}Re: Tasks@{ub} <<< No Message Collected >>> @ENDNODE @NODE "Mail_60" " Re: pure programs " From: Duane McDonnell Date: 01-15-00 06:53:13 Subject: @{b}Re: pure programs@{ub} From: Duane McDonnell >From: Linus McCabe >I recently had to reinstall my entire system after a hdcrash. >At first everything (well, almost) worked fine but all of a sudden >'assign' wasnt working properly anymore. If I tried to make an >'assign xxx: dismount' nothing would happen; if I tried to make an >'assign mui:libs/ add' the specified directory would not be added to >the libs: assign, but instead would the 'LIBS:' assign be renamed to >'.IBS:'. Wierdest thing. >After a while I noticed that if I used c:assign instead of just >'assign' everything worked, and I then took away the 'resident assign >pure' from the startup-sequence. Now it all works. >Now to my question. Did all this happen because assign is not really a >pure program, or what else could it be? It sounds like Assign is not re-entrant. >If a program is not pure, will it still work as a resident program if >its only run once at a time, or does that not matter? It does matter, since variables won't be reset to the usual load defaults when made resident. That would explain why C:Assign works fine (it's loaded from disk/cache each time) but resident Assign without the "P" attribute does not. >and why did it work before? Sounds like you lost the "P" attribute during the re-install. Check that C:Assign has the "P" attribute set. It should be set. Use "Protect C:Assign +P" to set it. If Assign's flags are incorrect you might want to assume that other commands are also incorrect. When copying, you generally want to clone the file exactly, however many copy programs don't do this by default and some don't allow it all. @ENDNODE @NODE "Mail_61" " Re: Re: Tasks " From: Duane McDonnell Date: 01-15-00 07:01:49 Subject: @{b}Re: Re: Tasks@{ub} From: Duane McDonnell >From: Ilkka Lehtoranta >Hello Olaf >On 13-Tam-00, you wrote: >OB> From: "Olaf Barthel" >OB> >OB> On Jan 13 Ilkka (Ilkka Lehtoranta) wrote: >OB> >OB>> From: Ilkka Lehtoranta >OB>> >OB>> Hello Nicholas >OB>> >OB>> On 08-Tam-00, you wrote: >OB>> >OB>>>> Exec uses unique identifiers for each task. Wether they work is >OB>>>> another matter. >OB>>>> >OB>>>> Where's the task ID stored? I can't see it in the Task structure. >OB>>> >OB>>> Well I see you need the asm includes. Since they are more upto >OB>> date. >OB>> >OB>> In addition, if you are using ASM includes from Developer CD 2.1 you >OB>> have to edit some files because they contain some errors... >OB> >OB> Such as? I'd like to get them fixed, if possible. >devices/printer.i and datatypes/pictureclass.i >From printer.i: > STRUCTURE IODRPReq,IO_SIZE > APTR io_RastPort ; raster port > APTR io_ColorMap ; color map > ULONG io_Modes ; graphics viewport modes > UWORD io_SrcX ; source x origin > UWORD io_SrcY ; source y origin > UWORD io_SrcWidth ; source x width > UWORD io_SrcHeight ; source x height > LONG io_DestCols ; destination x width > LONG io_DestRows ; destination y height > UWORD io_Special ; option flags > LABEL iodrpr_SIZEOF > STRUCTURE IODRPTagsReq,IO_SIZE > APTR io_RastPort ; raster port > APTR io_ColorMap ; color map > ULONG io_Modes ; graphics viewport modes > UWORD io_SrcX ; source x origin > UWORD io_SrcY ; source y origin > UWORD io_SrcWidth ; source x width > UWORD io_SrcHeight ; source x height > LONG io_DestCols ; destination x width > LONG io_DestRows ; destination y height > UWORD io_Special ; option flags > APTR io_TagList ; tag list > LABEL iodrpr_SIZEOF >In ASM you can't use symbol names twice. A similar balls-up with es_SIZEOF caused me many hours of debugging to track down. @ENDNODE @NODE "Mail_62" " Re: pure programs " From: Linus McCabe Date: 01-15-00 08:27:35 Subject: @{b}Re: pure programs@{ub} From: Linus McCabe On 16-Jan-00, Stephen Illingworth wrote: > No, the opposite is true. The P attribute indicates that the program > is re-entrant AND re-executable, a category the standard Assign > program almost certainly finds itself in. Are you sure you're using > the standard program and not a third-party replacement? Yes, thats what I thought too and it makes more sence.. Its the assign that came on my 3.0 disk.. odd, huh? /Linus Linus McCabe * Sparkle@hehe.com * Sparkle, #Amiga, DalNet * http://sparkle.amiga.tm One does not thank logic, Amanda @ENDNODE @NODE "Mail_63" " Re: pure programs " From: Jonas Hulten Date: 01-15-00 09:40:17 Subject: @{b}Re: pure programs@{ub} From: Jonas Hulten Den 13-Jan-00, skrev Linus McCabe: > I recently had to reinstall my entire system after a hdcrash. > At first everything (well, almost) worked fine but all of a sudden > 'assign' wasnt working properly anymore. If I tried to make an > 'assign xxx: dismount' nothing would happen; if I tried to make an You didn't just want to REMOVE it? I rarely use DISMOUNT. > 'assign mui:libs/ add' the specified directory would not be added to ^ | Forgot LIBS: here? > the libs: assign, but instead would the 'LIBS:' assign be renamed to > '.IBS:'. Wierdest thing. > After a while I noticed that if I used c:assign instead of just > 'assign' everything worked, and I then took away the 'resident assign > pure' from the startup-sequence. Now it all works. > Now to my question. Did all this happen because assign is not really a > pure program, or what else could it be? I believe assign is a pure program. I use resident and it works. > If a program is not pure, will it still work as a resident program if > its only run once at a time, or does that not matter? I think it will at least run once, then some data may have changed in memory and some programs will not work twice. If they do work twice they may also work more times. It will probably fail to run several times in parallel. > and why did it work before? Why didn't it work now is my question... Try to copy assign from the workbench disks to make sure that it hasn't been trashed. /Jonas 0 "MEAT IS MURDER " GRRRL 48 "JETPAC" PRG 20 "JELLY MONSTERS" PRG 32 " BEE" REL 42 "VECTREX" REL 604 "A4000" L?< 64 BLOCKS FREE. @ENDNODE @NODE "Mail_64" " Re: pure programs " From: Stephen Illingworth Date: 01-16-00 01:29:16 Subject: @{b}Re: pure programs@{ub} From: Stephen Illingworth Hello Linus On 14-Jan-00, you wrote: > From: Linus McCabe > Hello Duane >> Sounds like you lost the "P" attribute during the re-install. > OK, so specifying the p flag indicates that the program is not > reerntrant? > it doesent even matter that much, i dont need it residen.. But thansk > for the info! No, the opposite is true. The P attribute indicates that the program is re-entrant AND re-executable, a category the standard Assign program almost certainly finds itself in. Are you sure you're using the standard program and not a third-party replacement? Steve. @ENDNODE @NODE "Mail_65" " Re: List Newbie + VBCC/BOOPSI questions " From: "Nathan J. Young" Date: 01-16-00 19:29:08 Subject: @{b}Re: List Newbie + VBCC/BOOPSI questions@{ub} From: "Nathan J. Young" Hello! On 10-Jan-20000, you wrote: > Are there any special considerations I need > to make to create BOOPSI classes in VBCC? Not to my knowledge, but then I have only recently started to write custom classes, so I can't offer any great big shiny pearls of wisdom. :) A couple of pit-falls to watch out for are: 1) Calls to printf() or puts() (debugging) in any dispatcher code. 2) Forgetting to use HookEntry() or register arguments for the dispatcher. > So before I start throwing code around This might turn out to be your best option! Kind regards Nathan @ENDNODE @NODE "Mail_66" " Screen colors wrong " From: Jack York Date: 01-16-00 20:05:11 Subject: @{b}Screen colors wrong@{ub} From: Jack York Hello, Please excuse me if this is not a subject for this list. I didn't know where else to ask for help. I have a program written with ClassAct. When I run it on OS 3.5 the colors are not correct. Every line drawn on the screen is black. White isn't used at all. It display fine under 3.1 and I know it ran with 3.5 at one point because I posted a question here about it losing memory when ran with 3.5. The other programs I have that use ClassAct are the ClassAct demo, Thor and Aweb and they all appear fine. So...I must be doing something in my program to cause the colors to be incorrect. I am using SA_FullPallete and SA_Colors but I tried removing them and it didn't change anything. I have installed a few utilities but nothing that should affect this I don't think. And even if they did, then the other programs should fail too. This brings it back to something I am doing wrong in the program. Any ideas? @ENDNODE @NODE "Mail_67" " Can somebody with OS35 do a test for me? " From: Niels de Koning Date: 01-16-00 21:23:56 Subject: @{b}Can somebody with OS35 do a test for me?@{ub} From: Niels de Koning Help! I am having problems with my OS35 installation regarding datatypes! Would somebody please be willing to help me by running a program and telling me what happens on their OS35 system? If you think you have correctly installed OS35 this test would not cost you more than a minute (and probably less....) If you want to help me I have to send you some testfiles, which are about 50kb as lzx. I understand that you don't want to run programs from somebody on the internet, so if you prefer I can send the source as well, so you can compile it for yourself (SAS-C). Just let me know what you prefer.... The program just loads a picture through the datatype system and outputs the picture in another format. btw, it is the program from a picture datatype developer archive My problem is that calling GetDTAttrs(...) with tag PDTA_BitMapHeader does not give me a bitmapheader. If you want an (even more) detailed description I can give you this as well..... Kind regards, //Niels de Koning ____________________________________________________________________ Co-editor on 3DAddict's GFXZone http://www.gfxzone.org @ENDNODE @NODE "Mail_68" " Re: pure programs " From: Colin Wenzel Date: 01-17-00 02:32:27 Subject: @{b}Re: pure programs@{ub} From: Colin Wenzel On 15-Jan-00, Jonas Hulten wrote: -snip- >> the libs: assign, but instead would the 'LIBS:' assign be renamed to >> '.IBS:'. Wierdest thing. >> After a while I noticed that if I used c:assign instead of just >> 'assign' everything worked, and I then took away the 'resident >> assign pure' from the startup-sequence. Now it all works. >> Now to my question. Did all this happen because assign is not really >> a pure program, or what else could it be? >> If a program is not pure, will it still work as a resident program >> if its only run once at a time, or does that not matter? >> and why did it work before? You're seeing the effect, not the cause. I bet you have some bad code somewhere & it's clobbering random memory. I had something just like this happen to me with one of my programs. Run Segtracker & Enforcer (or cyber-thingy) from your Startup-sequence, (just after setpatch) & watch the fireworks...... Your system is probably partially already crippled before WB loads. ------------------------------------- Colin Wenzel. Australia. EMAIL: mailto:colstv@hotkey.net.au URL: http://www.hotkey.net.au/~colstv/ ICQ: 17608330 MADE WITH 'AMIGA' 4000T With O.S 3.1 --------------------------------------- @ENDNODE @NODE "Mail_69" " Re: Re: pure programs " From: Duane McDonnell Date: 01-17-00 04:52:57 Subject: @{b}Re: Re: pure programs@{ub} From: Duane McDonnell >From: Linus McCabe >On 16-Jan-00, Stephen Illingworth wrote: >> No, the opposite is true. The P attribute indicates that the program >> is re-entrant AND re-executable, a category the standard Assign >> program almost certainly finds itself in. Are you sure you're using >> the standard program and not a third-party replacement? >Yes, thats what I thought too and it makes more sence.. Sorry, my reply could have given that impression. The P attribute flags re-entrant/multi-thread compatible code. I was asking you to set the bit if it wasn't already. > Its the assign >that came on my 3.0 disk.. odd, huh? I think Colin's advice to run Enforcer early during bootup should track down the problem. The standard Assign is pure and shouldn't behave the way you describe. It's strange that this happens consistently however, it doesn't sound like a completely random effect. Let us know if you track down the problem, I for one would be interested to know how this happened. @ENDNODE @NODE "Mail_70" " RE: Re: List Newbie + VBCC/BOOPSI questions " From: "Sealey, M." Date: 01-17-00 10:03:00 Subject: @{b}RE: Re: List Newbie + VBCC/BOOPSI questions@{ub} From: "Sealey, M." > On 10-Jan-20000, you wrote: > > Are there any special considerations I need > > to make to create BOOPSI classes in VBCC? > Not to my knowledge, but then I have only recently started to > write custom classes, so I can't offer any great big shiny > pearls of wisdom. :) Doh! :) > A couple of pit-falls to watch out for are: > 1) Calls to printf() or puts() (debugging) in any > dispatcher code. I realise I can't do that. My main problem is in the library init: I thought I solved a ramlib crash by fixing a tiny typo in my code and then I started getting application crashes - then when I fixed the application crashes (I assigned SysBase to a NULL pointer.. oops ;) then I got the ramlib crash back. Basically it's accessing memory from a NULL pointer somewhere, and backing up $12e bytes before reading data out. Quite what that value $12e means I don't know, all I do know is that the address is gets back is that many bytes below the 4Gb boundary ;) > 2) Forgetting to use HookEntry() or register arguments for > the dispatcher. Oh. I've done all that. The dispatcher is fine, it's the library init. I'm converting code from SAS/C into something I can compile in VBCC, and every time I compile it, it bombs > > So before I start throwing code around > This might turn out to be your best option! I don't know whether I should, it's not exactly the sort of code I can start throwing onto mailing lists (however mundane it is) because it's part of Reaction :) Matt Sealey mws2@le.ac.uk Distributed Systems Support Computer Centre University of Leicester @ENDNODE @NODE "Mail_71" " HiSOFT C++ and MUI and Hooks... " From: Alexander Niven-Jenkins Date: 01-17-00 21:20:23 Subject: @{b}HiSOFT C++ and MUI and Hooks...@{ub} From: Alexander Niven-Jenkins Hiya, I am writing this MUI program, although this isn't really the problem. Doing the basic GUI etc works fine. However I'm having trouble doing hooks for things like a custom popup object. As a starter for 10 I tried to compile the demo 'popup.c' but I get 'Initialiser has invalid type' errors for the declarations of the Hook structures. Has any one any example source that compiles with HSC++ on this? Any help appreciated, thanks. Kind regards... Cremlin Software - http://www.cremlinsoftware.org Founder, lead programmer - ghandi@cremlinsoftware.org Production, programmer - anj@cremlinsoftware.org @ENDNODE @NODE "Mail_72" " Re: List Newbie + VBCC/BOOPSI questions " From: "Nathan J. Young" Date: 01-17-00 22:33:49 Subject: @{b}Re: List Newbie + VBCC/BOOPSI questions@{ub} From: "Nathan J. Young" Hello! On 10-Jan-20000, you wrote: > Are there any special considerations I need > to make to create BOOPSI classes in VBCC? Not to my knowledge, but then I have only recently started to write custom classes, so I can't offer any great big shiny pearls of wisdom. :) A couple of pit-falls to watch out for are: 1) Calls to printf() or puts() (debugging) in any dispatcher code. 2) Forgetting to use HookEntry() or register arguments for the dispatcher. > So before I start throwing code around This might turn out to be your best option! Kind regards Nathan @ENDNODE @NODE "Mail_73" " Re: HiSOFT C++ and MUI and Hooks... " From: Allan Odgaard Date: 01-18-00 08:56:57 Subject: @{b}Re: HiSOFT C++ and MUI and Hooks...@{ub} From: Allan Odgaard On 17-Jan-00, Alexander Niven-Jenkins wrote: > As a starter for 10 I tried to compile the demo 'popup.c' but I get > 'Initialiser has invalid type' errors for the declarations of the Hook > structures. C++ has stronger typechecking, so here a hook structure must be initialized as: struct Hook hook = { { NULL, NULL }, (ULONG(*)())func, NULL, (APTR)udata }; You can also use the HOOKFUNC typedef from utility/hook.h, i.e. struct Hook hook = { { NULL, NULL }, (HOOKFUNC)func, NULL, (APTR)udata }; You can ommit the two last members, if you don't use the h_Data field. Regards Allan URL: http://www.DIKU.dk/students/duff/ DOS Tip #17: Add DEVICE=FNGRCROS.SYS to CONFIG.SYS @ENDNODE @NODE "Mail_74" " Re: HiSOFT C++ and MUI and Hooks... " From: Alexander Niven-Jenkins Date: 01-18-00 22:14:06 Subject: @{b}Re: HiSOFT C++ and MUI and Hooks...@{ub} From: Alexander Niven-Jenkins Hiya Allan, On 18-Jan-00, you wrote: > C++ has stronger typechecking, so here a hook structure must be > initialized as: > struct Hook hook = { { NULL, NULL }, (ULONG(*)())func, NULL, (APTR)udata > You can also use the HOOKFUNC typedef from utility/hook.h, i.e. > struct Hook hook = { { NULL, NULL }, (HOOKFUNC)func, NULL, (APTR)udata I should have thought of this already as I have had to cast so much due it's stricter requirements, just went over my head :-) Thanks. Kind regards... Cremlin Software - http://www.cremlinsoftware.org Founder, lead programmer - ghandi@cremlinsoftware.org Production, programmer - anj@cremlinsoftware.org @ENDNODE @NODE "Mail_75" " HiSOFT C++ and starting from WB... " From: Alexander Niven-Jenkins Date: 01-18-00 22:24:30 Subject: @{b}HiSOFT C++ and starting from WB...@{ub} From: Alexander Niven-Jenkins Hiya, This is probably specific to HiSOFT C++ (unfortuntely). My program runs either from CLI or WB, if run from the CLI it goes the ReadArgs() way and if run from WB it opens the GUI. The problem is that if run from WB, I can't get it to output any startup errors to the console (libraries failing to open etc). Once the GUI is up errors are displayed by a requester, so this isn't a problem, it's solely errors which occur before the GUI is available. I've tried the simple route as in 'cout << blah' and every combination of printf etc but to no joy, a console window doesn't open. Does anybody have any idea how to solve this? Unfortunately the wbstartup.h code only has german comments so it might tell me in there but not knowing german I don't know (below is the bit) :-) #ifdef WBWINNAME // Ausgabe in Window umleiten: if(!freopen(WBWINNAME, "r+", stdout)) return; // Eingabe aus selbem Window: stdin->Filehandle = stdout->Filehandle; // THIS ASSIGNMENT WAS MADE // BY TRAINED EXPERTS. DO NOT TRY THIS AT HOME! #endif Kind regards... Cremlin Software - http://www.cremlinsoftware.org Founder, lead programmer - ghandi@cremlinsoftware.org Production, programmer - anj@cremlinsoftware.org @ENDNODE @NODE "Mail_76" " HiSOFT C++ and starting from WB... " From: Tak Tang Date: 01-20-00 14:15:36 Subject: @{b}HiSOFT C++ and starting from WB...@{ub} From: "Tak Tang" I do not have any experience with Hisoft C++, but I would try opening CON as a file. int main(int argc, char *argv[]) FILE *myconfh; struct Library *IntuitionBase; myconfh = fopen("CON:Debug output/0/0/320/100", "w"); ... a check to make sure it opened OK IntuitionBase = OpenLibrary("intuition.library", 0L); if (!IntuitionBase) fprintf(myconfh,"Help! Can not open intuition library!\n"); ... probably abort Tak Tang Let the good times roll. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. ********************************************************************** @ENDNODE @NODE "Mail_77" " Joysticks " From: "Alastair M. Robinson" Date: 01-20-00 22:49:05 Subject: @{b}Joysticks@{ub} From: "Alastair M. Robinson" Hi everyone, I'm considering the possiblity of creating a new API for joysticks, since we don't currently have anything which can abstract reading 4-player adapters, megadrive controllers, four-player parallel-port adapters, etc. away from the hardware. Before I devote much time to this, does anyone know if anyone else is already working on something along these lines? I don't want to do this all by myself and then find it doesn't suit the needs of others, so I want *input*! If you're at all interested and have a little spare bandwidth, mail me privately and I'll send you my preliminary thoughts on the subject, and invite your comments/suggestions/help/routines/ whatever. All the best, Alastair M. Robinson, email:blackfive@fakenhamweb.co.uk Amiga 4000/030, 18Meg RAM, 4.3Gig HD, Mustek ScanExpress 6000SP C, Assembler (68k, PIC16C84, learning ATMEL AVR), PostScript, ARexx, AMOSPro(!), AmigaDOS "American Airlines. Fly with us and you won't walk again." -- Sign seen in L.A. @ENDNODE @NODE "Mail_78" " Re: HiSOFT C++ and starting from WB... " From: Andrew Bell Date: 01-21-00 01:35:42 Subject: @{b}Re: HiSOFT C++ and starting from WB...@{ub} From: Andrew Bell Hi Tak, On 20-Jan-00 you wrote: [amiga-c] HiSOFT C++ and starting from WB... > I do not have any experience with Hisoft C++, but I would try > opening CON as a file. Remember, you have two entry points with Hisoft C++. main() is called when your program is started from Shell and wbmain() for Workbench. This small example will allow you to print your debugging information when started from Workbench (that is, if I haven't made any typos :-). #include #include int main( void ) BPTR FH; FH = Open("CON:0/11/640/120/Debug_window/CLOSE/WAIT", MODE_WRITE); if (FH) VFPrintf(FH, "Hello!\n"); Close(FH); return 0; int wbmain( void ) return main(); Regards, Andrew Bell. +----------------------------------------+ email: mailto:andrew.ab2000@bigfoot.com or mailto:andrew@ab2000.prestel.co.uk web: http://www2.prestel.co.uk/ab2000 +----------------------------------------+ Just paint your face in shadows dark. @ENDNODE @NODE "Mail_79" " How to print text fast? " From: Allan Odgaard Date: 01-21-00 12:44:01 Subject: @{b}How to print text fast?@{ub} From: Allan Odgaard Hi there, Anybody experimented with fast ways to write text to the screen? I've created my own set of text functions to do anti-alised text, but I'd love to see them become faster, which is why I ask here for inspiration. Currently I create each bitplane in an off-screen buffer (using the cpu) and then I move these to the screen with BltTemplate(). The first procedure is simply a (bit-wise) copy since I have each glyph separated in planes (each plane being a colour, that way I can easily change the colour range used) With this approach I can write ~3300 characters pr. second (16 levels of grey, 14 pixels tall font (Arial), 040 @ 40MHz + PicassoIV) if I settle with 9 levels of grey than I can output twice as many characters, but there still is a long way to go before the appearance of an entire page won't be crawling... Regards Allan URL: http://www.DIKU.dk/students/duff/ Quoting one is plagiarism. Quoting many is research. @ENDNODE @NODE "Mail_80" " About CGI scripts in C++ and address correction. " From: Dr Brain Damage Date: 01-21-00 16:52:02 Subject: @{b}About CGI scripts in C++ and address correction.@{ub} From: "Dr Brain Damage" Does anyone know where to find instructions on how to do CGI-Scripts with C/C++? i have tried to find it from net but because of my limited time on net, i havent been able to find anything. Or could someone send me instructions on how to do CGI-Scripts with C++? and for other thing. i marketed you once about that free e-mail giver Planetlink.8k.com, how ever i putted wrong address. i putted http://planetlinks.8k.com when its actually: http://planetlink.8k.com so no links but link. - Dr.BrainDamage Angelfire for your free web-based e-mail. http://www.angelfire.com @ENDNODE @NODE "Mail_81" " Re: HiSOFT C++ and starting from WB... " From: Alexander Niven-Jenkins Date: 01-21-00 18:10:27 Subject: @{b}Re: HiSOFT C++ and starting from WB...@{ub} From: Alexander Niven-Jenkins Hiya Tak, On 20-Jan-00, you wrote: > I do not have any experience with Hisoft C++, but I would try opening CON > as a file. Yep, thanks, I was forgetting you could do this :-) Kind regards... Cremlin Software - http://www.cremlinsoftware.org Founder, lead programmer - ghandi@cremlinsoftware.org Production, programmer - anj@cremlinsoftware.org @ENDNODE @NODE "Mail_82" " Re: How to print text fast? " From: Duane McDonnell Date: 01-21-00 18:54:21 Subject: @{b}Re: How to print text fast?@{ub} From: Duane McDonnell >From: Allan Odgaard >Hi there, >Anybody experimented with fast ways to write text to the screen? I've created >my own set of text functions to do anti-alised text, but I'd love to see them >become faster, which is why I ask here for inspiration. >Currently I create each bitplane in an off-screen buffer (using the cpu) and Aren't the bitplanes pre-calculated? >then I move these to the screen with BltTemplate(). The first procedure is >simply a (bit-wise) copy since I have each glyph separated in planes (each >plane being a colour, that way I can easily change the colour range used) SetWriteMask() optimizations should be worthwhile for native chipset displays. >With this approach I can write ~3300 characters pr. second (16 levels of grey, >14 pixels tall font (Arial), 040 @ 40MHz + PicassoIV) if I settle with 9 >levels of grey than I can output twice as many characters, I don't understand this part, since 9 and 14 grey levels imply the same number of bitplanes so there should be no speed difference with pre-calculated bitplanes. Are you doing realtime anti-aliasing? > but there still is >a long way to go before the appearance of an entire page won't be crawling... If your primary target audience is gfx board users you might want to experiment with chunky rendering. It's a bit fruitless trying to guage the effectiveness of bitplane optimizations with RTG patches installed so don't forget to test native performance too. Cheers, @ENDNODE @NODE "Mail_83" " Re: How to print text fast? " From: Duane McDonnell Date: 01-21-00 19:03:47 Subject: @{b}Re: How to print text fast?@{ub} From: Duane McDonnell >From: Duane McDonnell >>From: Allan Odgaard >>With this approach I can write ~3300 characters pr. second (16 levels of >grey, >>14 pixels tall font (Arial), 040 @ 40MHz + PicassoIV) if I settle with 9 >>levels of grey than I can output twice as many characters, >I don't understand this part, since 9 and 14 grey levels imply the ^^ 16 even. I should know better than to reply at 3 in the morning ;-) @ENDNODE @NODE "Mail_84" " Re: About CGI scripts in C++ and address correction. " From: Allan Odgaard Date: 01-21-00 20:13:33 Subject: @{b}Re: About CGI scripts in C++ and address correction.@{ub} From: Allan Odgaard On 21-Jan-00, Dr Brain Damage wrote: > Does anyone know where to find instructions on how to do CGI-Scripts with > C/C++? AFAIK you read the potential arguments from stdin and output your generated HTML page to stdout. But it depends a little on the http-server you're using. Regards Allan URL: http://www.DIKU.dk/students/duff/ Reality is for people who lack imagination. @ENDNODE @NODE "Mail_85" " Re: How to print text fast? " From: Allan Odgaard Date: 01-21-00 20:35:40 Subject: @{b}Re: How to print text fast?@{ub} From: Allan Odgaard On 21-Jan-00, Duane McDonnell wrote: >> Anybody experimented with fast ways to write text to the screen? I've >> created my own set of text functions to do anti-alised text, but I'd love to >> see them become faster, which is why I ask here for inspiration. Currently I >> create each bitplane in an off-screen buffer (using the cpu) and > Aren't the bitplanes pre-calculated? Yes, for each glyph. The bitplane I create is for a complete string of text. Which seemed to be faster to put together with the cpu than to blit every character to the screen. >> then I move these to the screen with BltTemplate(). The first procedure is >> simply a (bit-wise) copy since I have each glyph separated in planes (each >> plane being a colour, that way I can easily change the colour range used) > SetWriteMask() optimizations should be worthwhile for native chipset > displays. I'm mainly targeting my efforts towards graphics cards. >> With this approach I can write ~3300 characters pr. second (16 levels of >> grey, 14 pixels tall font (Arial), 040 @ 40MHz + PicassoIV) if I settle >> with 9 levels of grey than I can output twice as many characters, > I don't understand this part, since 9 and 14 grey levels imply the > same number of bitplanes so there should be no speed difference with > pre-calculated bitplanes. Are you doing realtime anti-aliasing? A bitplane refers only to a single colour, since they're used with BltTemplate() -- so 16 levels of grey requires 16 'bitplanes' -- if I were to pack together the planes then I wouldn't be able to change the pen values used for the colour range, without actually remapping the bitplanes. And since the text is printed on many different coloured backgrounds, that wouldn't be feasible. Btw: I did a few optimizations and compiled it with some better options. So I can now do ~7800 letters pr. second. I estimate that I'd need to do atleast 50.000 l/s before page-scroll isn't a pain... :-( > If your primary target audience is gfx board users you might want to > experiment with chunky rendering. It's a bit fruitless trying to guage > the effectiveness of bitplane optimizations with RTG patches installed > so don't forget to test native performance too. I didn't look into assembling the entire bitmap in fast-ram, since I figured that'd give me problems writting in JAM1-mode, but as I do know the background (in most cases) then that's something I'll try :-) But how do you recommend that I move my pixels to the gfx. card? Using WritePixelArray8() will ensure AGA compatibility, but how fast is this on high colour screens? Sometimes I get a feeling that if I were to output my gfx. in the pixel-format used by the screen, I'd get a speedup. But since this requires converting code on my part then I don't see why that should be any faster than what's already in WritePixelArray() -- and I don't really want to support 15+ different formats... Regards Allan URL: http://www.DIKU.dk/students/duff/ Windows has found an unknown device and is installing a driver for it. @ENDNODE @NODE "Mail_86" " Re: How to print text fast? " From: Allan Odgaard Date: 01-21-00 20:53:42 Subject: @{b}Re: How to print text fast?@{ub} From: Allan Odgaard On 21-Jan-00, Allan Odgaard wrote: > I didn't look into assembling the entire bitmap in fast-ram, since I figured > that'd give me problems writting in JAM1-mode [...] I just recalled that the other problem were that on high colour screens I only allocate one exclusive pen, and change the colour of this after each blit, as a 'fancy' document would otherwise drain the system for pens and/or give inexact results -- but for this family of screens I could probably calculate a 24 bit buffer and use an RTG function to write it out to the gfx. card... Regards Allan URL: http://www.DIKU.dk/students/duff/ WinErr 43e: Modem driver corrupt. Download latest version any try again. @ENDNODE @NODE "Mail_87" " Re: Re: About CGI scripts in C++ and address correction. " From: Andrija Antonijevic Date: 01-22-00 04:57:20 Subject: @{b}Re: Re: About CGI scripts in C++ and address correction.@{ub} From: Andrija Antonijevic History books say that Allan Odgaard spoke these words on 21-Jan-00 AD. >On 21-Jan-00, Dr Brain Damage wrote: >> Does anyone know where to find instructions on how to do CGI-Scripts with >> C/C++? >AFAIK you read the potential arguments from stdin and output your generated >HTML page to stdout. But it depends a little on the http-server you're using. Sorry I'm replying to your message, Allan, I missed the original one. The most basic thing that will work is: int main(void) printf("Content-type: text/plain\r\n"); printf("Some-More-HTTP-Headers: blah-blah\r\n"); printf("\r\n"); /* I have no more headers */ printf("What you actually want to send here\n"); exit(0); /* Or something else if something went wrong */ Basically, you are adding HTTP headers (such as Content-Type, Content-Length or similar) and then the actual content (these two are separated by a single "\r\n") There are some ENV valiables that you might use (such as REMOTE_HOST, REMOTE_ADDR), but you should check out http://search.ietf.org/internet-drafts/draft-coar-cgi-v11-03.txt which will tell you more about it... /// /_\ _ _| |_ ___ _ _ _ _ http://www.bigfoot.com/~TheAntony __ /// / _ \| ' \ _/ _ \ ' \ || | Amiga Translators' Organization \\\/// /_/ \_\_||_\__\___/_||_\_, | (*Serbian department*) \XX/ TheAntony@bigfoot.com |__/ Team *AMIGA* Let's organize this thing and take all the fun out of it. @ENDNODE @NODE "Mail_88" " Re: About CGI scripts in C++ and address correction. " From: Allan Odgaard Date: 01-22-00 08:32:48 Subject: @{b}Re: About CGI scripts in C++ and address correction.@{ub} From: Allan Odgaard On 22-Jan-00, Andrija Antonijevic wrote: > Basically, you are adding HTTP headers (such as Content-Type, > Content-Length or similar) and then the actual content (these two are > separated by a single "\r\n") And please add a date-header if your contents isn't too dynamic, as that'll allow browsers to use the cached version rather than re-fetching it... the various headers are described in RFC 2068 (HTTP\1.1) Regards Allan URL: http://www.DIKU.dk/students/duff/ Have you crashed your Windows today? @ENDNODE @NODE "Mail_89" " Re: About CGI scripts in C++ and address correction. " From: Duane McDonnell Date: 01-22-00 09:02:31 Subject: @{b}Re: About CGI scripts in C++ and address correction.@{ub} From: Duane McDonnell >From: "Dr Brain Damage" >Does anyone know where to find instructions on how to do CGI-Scripts with >C/C++? If you need a practical example, here's some C source to a CGI script which accepts parameters for generating tiling procedural textures. It returns a HTML page to load and tile the JPEG format texture. http://ncca.bournemouth.ac.uk/Staff/Willi/TextureMC/texmc.c @ENDNODE @NODE "Mail_90" " Re: About CGI scripts in C++ and address correction. " From: Stephen Illingworth Date: 01-22-00 11:44:04 Subject: @{b}Re: About CGI scripts in C++ and address correction.@{ub} From: Stephen Illingworth > From: "Dr Brain Damage" > Does anyone know where to find instructions on how to do CGI-Scripts with > C/C++? Have a look at the following, http://www.boutell.com/cgic/ Steve @ENDNODE @NODE "Mail_91" " Re: Re: How to print text fast? " From: Duane McDonnell Date: 01-22-00 12:55:22 Subject: @{b}Re: Re: How to print text fast?@{ub} From: Duane McDonnell >A bitplane refers only to a single colour, since they're used with >BltTemplate() -- so 16 levels of grey requires 16 'bitplanes' -- if I were to >pack together the planes then I wouldn't be able to change the pen values >for the colour range, without actually remapping the bitplanes. And since the >text is printed on many different coloured backgrounds, that wouldn't be >feasible. I see. I haven't used BltTemplate() before but it strikes me as being a high overhead solution for this particular problem. Another way to approach the problem might be to pre-calculate a font for each color required (I imagine each font consists of a base color and the anti-aliasing colors?) Depending upon your requirements, this might be feasible memory wise. You can then blit directly in planar format. >Btw: I did a few optimizations and compiled it with some better options. >So I can now do ~7800 letters pr. second. I estimate that I'd need to >do atleast 50.000 l/s before page-scroll isn't a pain... :-( I think pre-calculation for each base color is the only way to achieve this using a planar design, that or investigating a chunky approach. >> If your primary target audience is gfx board users you might want to >> experiment with chunky rendering. It's a bit fruitless trying to guage >> the effectiveness of bitplane optimizations with RTG patches installed >> so don't forget to test native performance too. >I didn't look into assembling the entire bitmap in fast-ram, since I figured >that'd give me problems writting in JAM1-mode, but as I do know the background >(in most cases) then that's something I'll try :-) If you can build everything off-screen (including the background) you can manage the logic operations yourself in your own optimized manner. Then a simple copy to the destination (or dirty rectangles for partial updates) will be sufficient. >But how do you recommend that I move my pixels to the gfx. card? Using >WritePixelArray8() will ensure AGA compatibility Well, that's really the deciding factor, do you need native support? If not, you could investigate using the RTG API functions directly which are likely to be more optimized. >, but how fast is this on high >colour screens? Sometimes I get a feeling that if I were to output my gfx. in >the pixel-format used by the screen, I'd get a speedup. But since this >requires converting code on my part then I don't see why that should be any >faster than what's already in WritePixelArray() WritePixelArray8() is basically a chunky to planar converter so I would expect this to be "reasonably fast" for RTG screens since converting between different chunky formats is no where near as complex as converting to planar format quickly. Experimentation is obviously required, you might be pleasantly surprised (for native displays, don't expect too much though :-) > -- and I don't really want to >support 15+ different formats... Yes, that is a hassle. You should also check Aminet for other options, you might find something already implemented which will make life easier for you. @ENDNODE @NODE "Mail_92" " HiSOFT C++ and starting from WB... " From: "Alastair M. Robinson" Date: 01-23-00 16:38:03 Subject: @{b}HiSOFT C++ and starting from WB...@{ub} From: "Alastair M. Robinson" Hi Alex, > Unfortunately the wbstartup.h code only has german comments so it might > tell me in there but not knowing german I don't know (below is the bit) :-) Well, I don't know German, or C++, but I'll try to help anyway! > #ifdef WBWINNAME > // Ausgabe in Window umleiten: > if(!freopen(WBWINNAME, "r+", stdout)) > return; > // Eingabe aus selbem Window: > stdin->Filehandle = stdout->Filehandle; // THIS ASSIGNMENT WAS MADE > // BY TRAINED EXPERTS. DO NOT TRY THIS AT HOME! > #endif Right, as I understand it, this is slightly hacky code which redefines stdin and stdout to a user-defined filename. You need to do something like this: #define WBWINNAME "con:0/0/640/100/auto/close" then #include the wbstartup code. Since this file actually contributes code rather than just definitions (when WBWINNAME is defined), it'll probably have to be #included in main(). Then again, I'm thinking C, not C++ so I might be wrong about this. int main() #include This will redefine stdin/out even if started from the shell; if HiSoft c++ provides an alternate wbmain() entry, put the include file there instead. If not, depending on what else is in wbstartup.h, you might get away with putting the include in a conditional, i.e if(WBenchMsg) // or whatever it's called under HiSOFT c++ #include All the best, Alastair M. Robinson, email:blackfive@fakenhamweb.co.uk Amiga 4000/030, 18Meg RAM, 4.3Gig HD, Mustek ScanExpress 6000SP C, Assembler (68k, PIC16C84, learning ATMEL AVR), PostScript, ARexx, AMOSPro(!), AmigaDOS The warranty explicitly states that under NO circumstances shall a rocket be returned to the manufacturer under its own power. @ENDNODE @NODE "Mail_93" " Re: psx controler help request. " From: "William W. Toner II" Date: 01-23-00 17:11:47 Subject: @{b}Re: psx controler help request.@{ub} From: "William W. Toner II" On 24-Jan-00, Kelly Samel wrote: > From: Kelly Samel > Hello Steven > On 23-Jan-00, you wrote: >> From: Steven Dobbs >> Hello, >> I was wondering and hoping if there is somebody out there who can >> supply some example code for controling the playstation controllers, >> inparticular, the analogue joypads and steering wheels. > Why not contact the author of APPE? He has produced an interface > that allows the use of PlayStation controllers on any Amiga. Just > check out the archive APPE1_2.lha on aminet for more information. > Hope that helps. ;) I sent my money off to this guy 3 or 4 months ago at least. He said he was going to send it out after I emailed a couple times, but have yet to see it. Ended up ordering the PSXport from Blitersoft, and received it yesterday, and seems to work quite well with Clickboom Quake, though I'm having problems with ADoom. Also, stay away from the Mad Catz controller item code 8026. I got this as I like the complete circle design diractional pads and the Sony controllers have it split into 4 buttons which are torture onmy thumb. Went out and got one of them today though, and it works fine. The Mad Catz one doesn't want to work at all, though the designer, Joe Fenton, says he uses a Mad Catz pad with no problems. It should see support in a Quake port and Shogo from what I hear, and Joe said that ADoom PPC 1.4 uses it. And I actually got it, which was nice. I wouldn't recommend the APPE at this point, as I think I got ripped off. He had months head start on Blittersoft's shipment, but the PSXport crossed the pond and went through customs already, I don't see any reason to think the APPE I ordered will arrive anytime soon, if ever. The PSXport disk does have developer stuff on it, so should suit Bill Toner bill@prodatasys.com @ENDNODE @NODE "Mail_94" " psx controler help request. " From: Steven Dobbs Date: 01-23-00 22:19:59 Subject: @{b}psx controler help request.@{ub} From: Steven Dobbs Hello, I was wondering and hoping if there is somebody out there who can supply some example code for controling the playstation controllers, inparticular, the analogue joypads and steering wheels. Regards Steven Dobbs @ENDNODE @NODE "Mail_95" " Re: psx controler help request. " From: Alexander Niven-Jenkins Date: 01-24-00 01:25:14 Subject: @{b}Re: psx controler help request.@{ub} From: Alexander Niven-Jenkins Hiya Steven, On 23-Jan-00, you wrote: > I was wondering and hoping if there is somebody out there who can > supply some example code for controling the playstation controllers, > inparticular, the analogue joypads and steering wheels. If this is via the PSX then look at most PSX source sites there's loads, even code for G-Con45 comptible guns. If it's via a PC/Amiga, I don't know, infact I don't even know the pin outs, I suspect someone like the Bleem author would be best here. Kind regards... Cremlin Software - http://www.cremlinsoftware.org Founder, lead programmer - ghandi@cremlinsoftware.org Production, programmer - anj@cremlinsoftware.org @ENDNODE @NODE "Mail_96" " Re: psx controler help request. " From: Kelly Samel Date: 01-24-00 02:25:16 Subject: @{b}Re: psx controler help request.@{ub} From: Kelly Samel Hello Steven On 23-Jan-00, you wrote: > From: Steven Dobbs > Hello, > I was wondering and hoping if there is somebody out there who can > supply some example code for controling the playstation controllers, > inparticular, the analogue joypads and steering wheels. Why not contact the author of APPE? He has produced an interface that allows the use of PlayStation controllers on any Amiga. Just check out the archive APPE1_2.lha on aminet for more information. Hope that helps. ;) @ENDNODE @NODE "Mail_97" " should I make my config.library public ??? " From: David Arbuthnot Date: 01-24-00 15:59:03 Subject: @{b}should I make my config.library public ???@{ub} From: David Arbuthnot Hello, I am working on a library for my current project and I was wondering if anybody would be interested in using it within their programs. This library is responsible for management of configuration data within my program it handles loading/saving of configuration data and stores the data until it is needed within my program however atm I am creating it in such a way that it will only recognise the config files that my program uses however my program uses standard iff files to store data so if anybody is interested in using it I would like to know because I am currently writing the interface to the library (it uses boopsi classes) and I would design some sort of interface so that it could be used easily used as all the classes for handling my config files are built in to the library atm so if you are interested please let me know. Kind regards Dave `Trebor' Arbuthnot If I have the time to think why do I never have the time to do anything ??? -- David Arbuthnot E-MAIL: Trabor@Digital.Prestel.co.uk WWW : http://www2.prestel.co.uk/Digital/ A1200, 6Mb RAM, 744Mb HD,GVP DSS8+ Sampler,HP Deskjet690C+ @ENDNODE @NODE "Mail_98" " Re: should I make my config.library public ??? " From: Christian Hattemer Date: 01-24-00 17:39:14 Subject: @{b}Re: should I make my config.library public ???@{ub} From: Christian Hattemer On 24-Jan-00 David Arbuthnot wrote: > I am working on a library for my current project and I was wondering > if anybody would be interested in using it within their programs. This > library is responsible for management of configuration data within my > program it handles loading/saving of configuration data and stores the I'd be interested to have a look at it. I use some code to handle an ASCII configfile. It's available as part of the ML-Support source on Aminet. I also have an improved version with better support for saving list contents, which is currently unreleased. Bye, Chris __ /// __ /// Amiga 4000T 040/40 Team *AMIGA* \\\/// \XX/ http://www.riednet.wh.tu-darmstadt.de/~chris/ Von der MIR wurden schon seit Tagen keine neuen Pannen mehr gemeldet. Grund: Das Funkger t ist kaputt... (RTL Samstag Nacht) @ENDNODE @NODE "Mail_99" " Re: HiSOFT C++ and starting from WB... " From: Alexander Niven-Jenkins Date: 01-26-00 01:19:43 Subject: @{b}Re: HiSOFT C++ and starting from WB...@{ub} From: Alexander Niven-Jenkins Hiya Alastair, On 23-Jan-00, you wrote: > Right, as I understand it, this is slightly hacky code which redefines > stdin and stdout to a user-defined filename. You need to do something like > this: > #define WBWINNAME "con:0/0/640/100/auto/close" Thanks alot, this is exactly what I needed to know, due to the way HiSOFt C++ works with dual entry points main() for CLI and wbmain() for wb, the WBWINNAME only comes into affect if run from WB which is exactly what I want. Kind regards... Cremlin Software - http://www.cremlinsoftware.org Founder, lead programmer - ghandi@cremlinsoftware.org Production, programmer - anj@cremlinsoftware.org @ENDNODE @NODE "Mail_100" " NewObject() from a seperate process??? " From: David Arbuthnot Date: 01-26-00 18:22:25 Subject: @{b}NewObject() from a seperate process???@{ub} From: David Arbuthnot Hello, I'm writing a library which requires a dos i/o which isn't a problem but as the dos process reads in the file can I use NewObject() on a class that is stored in my library's base??? Kind regards Dave `Trebor' Arbuthnot If I have the time to think why do I never have the time to do anything ??? -- David Arbuthnot E-MAIL: Trabor@Digital.Prestel.co.uk WWW : http://www2.prestel.co.uk/Digital/ A1200, 6Mb RAM, 744Mb HD,GVP DSS8+ Sampler,HP Deskjet690C+ @ENDNODE @NODE "Mail_101" " Pattern dither in Adobe Photoshop, how and what? " From: Allan Odgaard Date: 01-27-00 11:54:53 Subject: @{b}Pattern dither in Adobe Photoshop, how and what?@{ub} From: Allan Odgaard Hi there, A friend of mine told me that Adobe Photoshop had a dither setting called 'pattern' and that this gave rather good results -- does anybody know the technique behind this? I don't have PS (nor a PC) so I can't test it myself, and I didn't find anything useful when using Google to search the net... Thanks in advance, Allan. URL: http://www.DIKU.dk/students/duff/ Quoting one is plagiarism. Quoting many is research. @ENDNODE @NODE "Mail_102" " Pattern dither follow up. " From: Allan Odgaard Date: 01-27-00 11:58:51 Subject: @{b}Pattern dither follow up.@{ub} From: Allan Odgaard Just to avoid misunderstandings: My friend told me that it wasn't just ordered dither with a new name. @ENDNODE @NODE "Mail_103" " Screensavers " From: ddawn347@yahoo.com Date: 01-27-00 18:38:07 Subject: @{b}Screensavers@{ub} From: ddawn347@yahoo.com Hi, all First let me tell you, I'm not a computer programmer, but I have an idea for a screensaver and I would like to create it. I m not computer illiterate, if I can learn to write a macro I can learn anything (right?) of course. Is there a program I can use to teach me how to program a screensaver? Or maybe there s a class I can take to learn how to write a screensaver? Any advice would be highly appreciated Thanks @ENDNODE @NODE "Mail_104" " Begginners-question regarding memory allocation " From: Stephan Huebner Date: 01-28-00 14:25:42 Subject: @{b}Begginners-question regarding memory allocation@{ub} From: Stephan Huebner Hello experts :), upto now I only used Blitzbasic and arexx for programming purposes. So memory allocation is something I didn't have to use. And that's my first question: Is it absolutely necessary to use memory allocation, for example if I want to make a database. I see the advantage that I can allocate the memory dynamically, but what other advantages are there? Wouldn't it be enough the do a structure of a database an array/pointers of it? And, how do I have to do the memory allocation? I mean, If I have an array, getting the different fields is clear, but if I allocate memory each time new data is entered, I also have to have a name for the allocated memory-part. But how can I have a different name each time and also can do it with a general function? Wouldn't I have to have some kind of array again? Sorry, if these are some silly questions, but I am completely lost at the moment... :-/ Greetings, Stephan Huebner Love: The decision to accept the whole of someone, regardless the details -- Otto Flake @ENDNODE @NODE "Mail_105" " Re: Begginners-question regarding memory allocation " From: Christian Hattemer Date: 01-28-00 15:33:06 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Christian Hattemer On 28-Jan-00 Stephan Huebner wrote: > question: Is it absolutely necessary to use memory allocation, for example > if I want to make a database. I see the advantage that I can allocate the > memory dynamically, but what other advantages are there? Wouldn't it be > enough the do a structure of a database an array/pointers of it? You need to do it dynamically. Otherwise you would be stuck with a fixed size of the database. The database would always take up memory for the whole size, even if there's only one entry. And when the database is full you wouldn't be able to add another record without recompiling the program. > And, how do I have to do the memory allocation? I mean, If I have an > array, getting the different fields is clear, but if I allocate memory > each time new data is entered, I also have to have a name for the > allocated memory-part. But how can I have a different name each time and > also can do it with a general function? Wouldn't I have to have some kind > of array again? Each time you add a record you allocate memory for the size of one record. You'll get a new memory area each time you do that, at least until the memory ist full... Of course you need to track where your records are in memory, to be able to access and free them on exit of your program. Bye, Chris __ /// __ /// Amiga 4000T 040/40 Team *AMIGA* \\\/// \XX/ http://www.riednet.wh.tu-darmstadt.de/~chris/ sar machte das Lager voll und jeder stand bei seinem Haufen @ENDNODE @NODE "Mail_106" " Bad Link Library " From: David Arbuthnot Date: 01-28-00 17:11:50 Subject: @{b}Bad Link Library@{ub} From: David Arbuthnot Hello, I recently created a shared library and then I decided to add the autoinit capabilities of Dice to it in the form of a link library (which contains a VarArgs stub to one of the calls in the library) but when I compiled a test program and linked it with the link lib everything was fine until the program was about to finish when a 0x0100000F recoverable alert popped up which indicates a bad FreeMem call however the call that causes the alert does not use freemem at all and I can't figure out whats wrong. I used Dice to compile the example and the fdtolib tool that comes with dice to generate the autoinit stuff and the DMakeFile which I used came from the WBStart source codes. Also I have compiled a working test program that doesn't use the link lib which indicates that the link lib is at fault Kind regards Dave `Trebor' Arbuthnot If I have the time to think why do I never have the time to do anything ??? -- David Arbuthnot E-MAIL: Trabor@Digital.Prestel.co.uk WWW : http://www2.prestel.co.uk/Digital/ A1200, 6Mb RAM, 744Mb HD,GVP DSS8+ Sampler,HP Deskjet690C+ @ENDNODE @NODE "Mail_107" " Re: Begginners-question regarding memory allocation " From: Charles Barr Date: 01-28-00 19:35:00 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Charles Barr Hello Christian On 28-Jan-00, you wrote: > From: Christian Hattemer > On 28-Jan-00 Stephan Huebner wrote: >> question: Is it absolutely necessary to use memory allocation, for >> example if I want to make a database. I see the advantage that I can >> allocate the memory dynamically, but what other advantages are there? >> Wouldn't it be enough the do a structure of a database an array/pointers >> of it? > You need to do it dynamically. Otherwise you would be stuck with a fixed > size of the database. The database would always take up memory for the > whole size, even if there's only one entry. And when the database is full > you wouldn't be able to add another record without recompiling the > program. >> And, how do I have to do the memory allocation? I mean, If I have an >> array, getting the different fields is clear, but if I allocate memory >> each time new data is entered, I also have to have a name for the >> allocated memory-part. But how can I have a different name each time and >> also can do it with a general function? Wouldn't I have to have some kind >> of array again? > Each time you add a record you allocate memory for the size of one record. > You'll get a new memory area each time you do that, at least until the > memory ist full... Of course you need to track where your records are in > memory, to be able to access and free them on exit of your program. Dont be using arrays anyway, Use Amiga List structures, It is then easier to keep track of allocated memory areas, and then free them. > Bye, Chris Regards @ENDNODE @NODE "Mail_108" " Re: Begginners-question regarding memory allocation " From: Tim Hanson Date: 01-28-00 20:23:30 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Tim Hanson Hi Stephan Stephan Huebner wrote this on 28-Jan-00 at 14:25:42 > And, how do I have to do the memory allocation? I mean, If I have an array, > getting the different fields is clear, but if I allocate memory each time > new data is entered, I also have to have a name for the allocated > memory-part. But how can I have a different name each time and also can do > it with a general function? Wouldn't I have to have some kind of array > again? Your best bet is to use a linked list. Check out the docs for NewList() AddHead() RemHead() Remove() Enqueue() etc. and use a structure like this: struct record struct Node mynode; char somedata[100]; int moredata; which can be cast as a struct Node * and given to the above functions. Or use a structure like this: struct record struct record *next; struct record *prev; char somedata[100]; }recordList; and do the linking yourself. eg: struct record *allocRecord() struct record *recordPtr; recordPtr=AllocVec(sizeof(struct record),MEMF_ANY); struct record *tempRecPtr; tempRecPtr=recordList.next; recordPtr->prev=&recordList; recordList.next=recordPtr; recordPtr->next=tempRecPtr; return recordPtr; NOTE: This code is awful. It should have error checking and it assumes that you have initialised recordList to zero. You can then walk the list with this. recordPtr=&recordList.next; while(recordPtr) { do stuff... recordPtr=recordPtr->next; } BTW pointers are the quickest way to crash you machine. Use with care. It wouldn`t suprise me if someone points out a grievous error in this code as I havn`t double checked it and it`s very easy to make mistakes. Tim Hanson, by the River,Canterbury, Kent. Amiga A1200T,`040/25,603e/160,32MB Fast,BVisionPPC, 170MB IDE HD,ZIP SCSI,RENO x2CD SCSI,Pace 56K Don`t waste your time by visiting http://www.sinister67.freeserve.co.uk @ENDNODE @NODE "Mail_109" " Re: Begginners-question regarding memory allocation " From: Stephan Huebner Date: 01-28-00 23:01:09 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Stephan Huebner Hello Christian On 28-Jan-00, you wrote: >> question: Is it absolutely necessary to use memory allocation, for >> example if I want to make a database. I see the advantage that I can >> allocate the memory dynamically, but what other advantages are there? >> Wouldn't it be enough the do a structure of a database an array/pointers >> of it? > You need to do it dynamically. Otherwise you would be stuck with a fixed > size of the database. The database would always take up memory for the > whole size, even if there's only one entry. And when the database is full > you wouldn't be able to add another record without recompiling the > program. As I said, silly question. I should have known that myself... :-/ > Each time you add a record you allocate memory for the size of one record. > You'll get a new memory area each time you do that, at least until the > memory ist full... Of course you need to track where your records are in > memory, to be able to access and free them on exit of your program. Yeah, but I think I will need some kind of "identifier" for each piece of memory.But Tim Hanson has kindly written some code-lines, will have a deeper look on that and see if it solves the problem... Greetings, Stephan shape: something which everyone has, but which looks better on young women -- Anonymous @ENDNODE @NODE "Mail_110" " Re: Begginners-question regarding memory allocation " From: Stephan Huebner Date: 01-28-00 23:06:01 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Stephan Huebner Hello Tim On 28-Jan-00, you wrote: > Your best bet is to use a linked list. Check out the docs for NewList() > AddHead() RemHead() Remove() Enqueue() etc. and use a structure like this: [snip] Thanks! Looks interesting, I think I am beginning to understand how those things can work. > BTW pointers are the quickest way to crash you machine. As if I wouldn't know that. :) When I started learning ansi-C, pointers made me mad! :-/ > Use with care. It > wouldn`t suprise me if someone points out a grievous error in this code as > I havn`t double checked it and it`s very easy to make mistakes. If I could I would shoot the guy who invented pointers! ;-) Greetings, Stephan Friendship: to listen to someone else like you wished he would listen to you -- Anonymous @ENDNODE @NODE "Mail_111" " Re: Begginners-question regarding memory allocation " From: Andrew Bell Date: 01-28-00 23:27:21 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Andrew Bell Hi Stephan, On 28-Jan-00 you wrote: [amiga-c] Begginners-question regarding memory allocation > Hello experts :), > upto now I only used Blitzbasic and arexx for programming purposes. > So memory allocation is something I didn't have to use. And that's > my first question: Is it absolutely necessary to use memory > allocation, for example if I want to make a database. I see the > advantage that I can allocate the memory dynamically, but what other > advantages are there? Wouldn't it be enough the do a structure of a > database an array/pointers of it? Arrays are fine for storing data records, but you'll eventually find yourself running out of entries because array are always fixed in length. You could get around this by defining a very large array, but you'll end up eating lots of memory. > And, how do I have to do the memory allocation? I mean, If I have an > array, getting the different fields is clear, but if I allocate > memory each time new data is entered, I also have to have a name for > the allocated memory-part. But how can I have a different name each > time and also can do it with a general function? Wouldn't I have to > have some kind of array again? Say for example your database program needs to store 5000 records, what you could do is define an array with 5000 pointers. Each pointer in this array will point to your record structure, which you can dynamically allocate with malloc() or the Amiga's AllocMem()/AllocVec() functions. An unused record slot in this array could be represented with a NULL. So when you add a record to your database, you'll have a loop which scans the whole array until it encounters a NULL, if it doesn't you'll know you're out of record slots. If it does, you can allocate your record structure, fill it in, and place the pointer to that record in your array, where you found the NULL. Of course, don't forget to free your records before your program quits. This is a very simply way of handling a database of records, but is limited to 5000 record slots. Another solution would would be to use linked lists, but linked lists take more work to setup and are difficult to manage, especially if you're just getting to grips with C. Basically with a linked list (Amiga style), you have a list header and a chain of "nodes". Each node in the chain contains a node structure and your record structure. The node structure contains information about the node itself plus information on where the next (and previous) node is located in memory. exec.library provides functions for manipulating linked lists, but you're better of learning how memory allocation works before you embark on using them. > Sorry, if these are some silly questions, but I am completely lost > at the moment... :-/ Don't worry about it, we all have to start somewhere. Regards, Andrew Bell. +----------------------------------------+ email: mailto:andrew.ab2000@bigfoot.com or mailto:andrew@ab2000.prestel.co.uk web: http://www2.prestel.co.uk/ab2000 +----------------------------------------+ Fear of crowded holiday shopping: Santa Claustrophobia @ENDNODE @NODE "Mail_112" " Re: Begginners-question regarding memory allocation " From: Charles Barr Date: 01-29-00 14:49:13 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Charles Barr Hello Andrew On 28-Jan-00, you wrote: > From: Andrew Bell > Hi Stephan, > On 28-Jan-00 you wrote: [amiga-c] Begginners-question regarding memory > allocation >> Hello experts :), >> upto now I only used Blitzbasic and arexx for programming purposes. >> So memory allocation is something I didn't have to use. And that's >> my first question: Is it absolutely necessary to use memory >> allocation, for example if I want to make a database. I see the >> advantage that I can allocate the memory dynamically, but what other >> advantages are there? Wouldn't it be enough the do a structure of a >> database an array/pointers of it? > Arrays are fine for storing data records, but you'll eventually find > yourself running out of entries because array are always fixed in > length. You could get around this by defining a very large array, but > you'll end up eating lots of memory. >> And, how do I have to do the memory allocation? I mean, If I have an >> array, getting the different fields is clear, but if I allocate >> memory each time new data is entered, I also have to have a name for >> the allocated memory-part. But how can I have a different name each >> time and also can do it with a general function? Wouldn't I have to >> have some kind of array again? > Say for example your database program needs to store 5000 records, > what you could do is define an array with 5000 pointers. Each pointer > in this array will point to your record structure, which you can > dynamically allocate with malloc() or the Amiga's > AllocMem()/AllocVec() functions. An unused record slot in this array > could be represented with a NULL. So when you add a record to your > database, you'll have a loop which scans the whole array until it > encounters a NULL, if it doesn't you'll know you're out of record > slots. If it does, you can allocate your record structure, fill it > in, and place the pointer to that record in your array, where you > found the NULL. Of course, don't forget to free your records before > your program quits. > This is a very simply way of handling a database of records, but is > limited to 5000 record slots. > Another solution would would be to use linked lists, but linked lists > take more work to setup and are difficult to manage, especially if > you're just getting to grips with C. > Basically with a linked list (Amiga style), you have a list header and > a chain of "nodes". Each node in the chain contains a node structure > and your record structure. The node structure contains information > about the node itself plus information on where the next (and > previous) node is located in memory. > exec.library provides functions for manipulating linked lists, but > you're better of learning how memory allocation works before you > embark on using them. >> Sorry, if these are some silly questions, but I am completely lost >> at the moment... :-/ Heres an example on using amiga linked lists i found, it might be useful. > Don't worry about it, we all have to start somewhere. > Regards, Andrew Bell. Regards @ENDNODE @NODE "Mail_113" " Re: Begginners-question regarding memory allocation (+attachments) " From: "Nathan J. Young" Date: 01-29-00 20:14:47 Subject: @{b}Re: Begginners-question regarding memory allocation (+attachments)@{ub} From: "Nathan J. Young" Hello Stephan, You've already received a few replies to this message, but I had started coding already. So I thought what the hell, a few more examples and ideas wouldn't hurt. :) BTW, all the examples were written in portable ANSI-C (I was away from home at the time). > And, how do I have to do the memory allocation? The files example1.c and example2.c show you how with descriptive comments. > Wouldn't I have to have some kind of array again? The files main.c, database.c and database.h demonstrate a *very* simple database using an array of pointers. The front-end to the program is a bit grotty, but it was only ment to be a quick example. The array of pointers is automatically resized when required. One advantage of implementing a database like this is fast sort times you can achieve, because only pointers are moved, not database records. Just an idea for you (I don't know if it's any good); An array of pointers does not consume very much memory. It would therefore be possible to have several arrays. Each one for referencing the database sorted on different keys. Finally, I appologise for any errors (design and implementation) in the source! Kind Regards Nathan @ENDNODE @NODE "Mail_114" " Re: Re: Begginners-question regarding memory allocation (+attachments " From: Duane McDonnell Date: 01-29-00 20:55:56 Subject: @{b}Re: Re: Begginners-question regarding memory allocation (+attachments@{ub} From: Duane McDonnell >From: "Nathan J. Young" >Hello Stephan, >You've already received a few replies to this message, but I had started >coding already. So I thought what the hell, a few more examples and ideas >wouldn't hurt. :) >BTW, all the examples were written in portable ANSI-C (I was away from home >the time). Wow, a lot of effort clearly went into that. Nice job! :-) The only comment I'd like to add (which I'm sure you know, I'm pointing this out for the benefit of Stephan) is that on the Amiga you should really stick with standard Exec lists and nodes rather than use custom lists or arrays. You often need to display lists in listview gadgets, but this requires standard Exec lists (of course, you can write a converter for this if required, but then things start to get messy). @ENDNODE @NODE "Mail_115" " Pattern dither in Adobe Photoshop, how and what? " From: "Alastair M. Robinson" Date: 01-29-00 22:22:53 Subject: @{b}Pattern dither in Adobe Photoshop, how and what?@{ub} From: "Alastair M. Robinson" Hi Allan, > A friend of mine told me that Adobe Photoshop had a dither setting called > 'pattern' and that this gave rather good results -- does anybody know the > technique behind this? I don't have PS (nor a PC) so I can't test it myself, > and I didn't find anything useful when using Google to search the net... I've not used PhotoShop myself, but I seem to remember reading (and it has been known for my memory to play tricks on me!) that Adobe hold a patent on one of PhotoShop's dither methods. The term 'pattern dither' rings a bell, so it could well have been this one. Is this query just out of interest, or do you need a dither method yourself? If so, I might be able to help out. All the best, Alastair M. Robinson, email:blackfive@fakenhamweb.co.uk Amiga 4000/030, 18Meg RAM, 4.3Gig HD, Mustek ScanExpress 6000SP C, Assembler (68k, PIC16C84, learning ATMEL AVR), PostScript, ARexx, AMOSPro(!), AmigaDOS A committee is a group that keeps minutes and loses hours. @ENDNODE @NODE "Mail_116" " Re: Begginners-question regarding memory allocation (+attachments) " From: Stephan Huebner Date: 01-30-00 01:54:45 Subject: @{b}Re: Begginners-question regarding memory allocation (+attachments)@{ub} From: Stephan Huebner Hello Nathan On 29-Jan-00, you wrote: > You've already received a few replies to this message, but I had started > coding already. So I thought what the hell, a few more examples and ideas > wouldn't hurt. :) No problem! :) The more examples I have the better it is. > BTW, all the examples were written in portable ANSI-C (I was away from > home at the time). That's nice, but I think I should be using Amiga-functions to avoid problems. >> And, how do I have to do the memory allocation? > The files example1.c and example2.c show you how with descriptive > comments. Great! You had a lot of time to write all those comments, didn't you? ;-) > The files main.c, database.c and database.h demonstrate a *very* simple > database using an array of pointers. The front-end to the program is a bit > grotty, but it was only ment to be a quick example. The array of pointers > is automatically resized when required. One advantage of implementing a > database like this is fast sort times you can achieve, because only > pointers are moved, not database records. Cool, another interesting method. But I think the linked-lists method is the best one. > Just an idea for you (I don't know if it's any good); Let's see. Even if I don't use it, it's good to see how things can be done. > An array of pointers does not consume very much memory. It would therefore > be possible to have several arrays. Each one for referencing the database > sorted on different keys. But even if it is only a small amount of memory it shouldn't be necessary, so I think I'll try the linked-list method. Greetings, Stephan Elephant: An animal which because of his colour can easily be mixed up with a mouse -- Anonymous @ENDNODE @NODE "Mail_117" " Re: Begginners-question regarding memory allocation " From: Stephan Huebner Date: 01-30-00 02:05:04 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Stephan Huebner Hello Andrew On 28-Jan-00, you wrote: > Arrays are fine for storing data records, but you'll eventually find > yourself running out of entries because array are always fixed in > length. You could get around this by defining a very large array, but > you'll end up eating lots of memory. Yeah, that's the problem I saw. Therefore I was looking for a better method > Say for example your database program needs to store 5000 records, > what you could do is define an array with 5000 pointers. [snip] > This is a very simply way of handling a database of records, but is > limited to 5000 record slots. And I would have to define an array again. And so I would loose the possibility of dynamically adding records if more than 5000 would be needed. > Another solution would would be to use linked lists, but linked lists > take more work to setup and are difficult to manage, especially if > you're just getting to grips with C. I'm trying out small things in ansi-c for quite a while now, so I think I will know how to do eat from the examples, some of the friendly guys out here sent me. > Basically with a linked list (Amiga style), you have a list header and > a chain of "nodes". Each node in the chain contains a node structure > and your record structure. The node structure contains information > about the node itself plus information on where the next (and > previous) node is located in memory. Seems like the gadgets-structure (or was it the requester-structure?) with references to the next and previous gadgets. I remember reading about it in the RKM. > exec.library provides functions for manipulating linked lists, but > you're better of learning how memory allocation works before you > embark on using them. BTW: What's the best autodoc-viewer? Maybe with converting them to AmigaGuide? Would help me much to find infos faster. Greetings, Stephan Freedom: A nice thing, but not if it's been bought with lonelyness -- Bertrand Russel @ENDNODE @NODE "Mail_118" " Re: Begginners-question regarding memory allocation (+attachments) " From: Allan Odgaard Date: 01-30-00 10:01:50 Subject: @{b}Re: Begginners-question regarding memory allocation (+attachments)@{ub} From: Allan Odgaard On 29-Jan-00, Nathan J. Young wrote: > You've already received a few replies to this message, but I had started > coding already. So I thought what the hell, a few more examples and ideas > wouldn't hurt. :) Please compress attachments when they exceed a few kilobytes! Regards Allan URL: http://www.DIKU.dk/students/duff/ Success is like a fart - only your own smells nice. -- James P. Hogan @ENDNODE @NODE "Mail_119" " Re: Begginners-question regarding memory allocation " From: Charles Barr Date: 01-30-00 12:23:43 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Charles Barr Hello Stephan On 30-Jan-00, you wrote: > From: Stephan Huebner > Hello Andrew > On 28-Jan-00, you wrote: >> Arrays are fine for storing data records, but you'll eventually find >> yourself running out of entries because array are always fixed in >> length. You could get around this by defining a very large array, but >> you'll end up eating lots of memory. > Yeah, that's the problem I saw. Therefore I was looking for a better > method :) >> Say for example your database program needs to store 5000 records, >> what you could do is define an array with 5000 pointers. > [snip] >> This is a very simply way of handling a database of records, but is >> limited to 5000 record slots. > And I would have to define an array again. And so I would loose the > possibility of dynamically adding records if more than 5000 would be > needed. >> Another solution would would be to use linked lists, but linked lists >> take more work to setup and are difficult to manage, especially if >> you're just getting to grips with C. > I'm trying out small things in ansi-c for quite a while now, so I think I > will know how to do eat from the examples, some of the friendly guys out > here sent me. >> Basically with a linked list (Amiga style), you have a list header and >> a chain of "nodes". Each node in the chain contains a node structure >> and your record structure. The node structure contains information >> about the node itself plus information on where the next (and >> previous) node is located in memory. > Seems like the gadgets-structure (or was it the requester-structure?) with > references to the next and previous gadgets. I remember reading about it > in the RKM. >> exec.library provides functions for manipulating linked lists, but >> you're better of learning how memory allocation works before you >> embark on using them. > BTW: What's the best autodoc-viewer? Maybe with converting them to > AmigaGuide? Would help me much to find infos faster. Get ADocReader from Aminet. I thinks its very good. well it does the job. > Greetings, > Stephan Regards @ENDNODE @NODE "Mail_120" " Mui future. " From: Vincent Morenas Date: 01-30-00 13:11:04 Subject: @{b}Mui future.@{ub} From: Vincent Morenas Hello, Does someone could tell me if the author of MUI plan to produce a 3.9 or 4.0 Version ?? Kind regards Vincent MORENAS. @ENDNODE @NODE "Mail_121" " Re: Begginners-question regarding memory allocation " From: Christian Hattemer Date: 01-30-00 18:19:18 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Christian Hattemer On 28-Jan-00 Charles Barr wrote: >> Each time you add a record you allocate memory for the size of one >> record. You'll get a new memory area each time you do that, at least >> until the memory ist full... Of course you need to track where your >> records are in memory, to be able to access and free them on exit of your >> program. > Dont be using arrays anyway, Use Amiga List structures, It is then easier > to keep track of allocated memory areas, and then free them. This is what I had in mind when writing the mail. I didn't mention it because I was in a hurry and didn't want to write too much confusing stuff in the first reply... I've got some code to offer which handles ASCII config files using exec lists. Should be enough as an lists example, although the latest version is currently unreleased. It's available as part of the ML-Support source on Aminet, look at Config.c and Config.h. Bye, Chris __ /// __ /// Amiga 4000T 040/40 Team *AMIGA* \\\/// \XX/ http://www.riednet.wh.tu-darmstadt.de/~chris/ Error #0190: Please remove Cat from Drive. @ENDNODE @NODE "Mail_122" " Re: Begginners-question regarding memory allocation " From: Jack York Date: 01-30-00 19:45:44 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Jack York Hello Stephan On 29-Jan-00, Stephan Huebner wrote: > From: Stephan Huebner > Hello Andrew > On 28-Jan-00, you wrote: >> Arrays are fine for storing data records, but you'll eventually find >> yourself running out of entries because array are always fixed in >> length. You could get around this by defining a very large array, but >> you'll end up eating lots of memory. > Yeah, that's the problem I saw. Therefore I was looking for a better > method :) > And I would have to define an array again. And so I would loose the > possibility of dynamically adding records if more than 5000 would be > needed. Arrays can be dynamically allocated and resized as needed without losing data. And the entries can be accessed much faster than with lists, barring the use of hash tables and the like. @ENDNODE @NODE "Mail_123" " Re: Begginners-question regarding memory allocation (+attachments) " From: "Nathan J. Young" Date: 01-30-00 21:20:19 Subject: @{b}Re: Begginners-question regarding memory allocation (+attachments)@{ub} From: "Nathan J. Young" Hi Stephan, >> BTW, all the examples were written in portable ANSI-C (I was away from >> home at the time). > That's nice, but I think I should be using Amiga-functions to avoid > problems. Problems? There should be no *real* problems - he says. :) If your database is to be an Amiga specific application then fine. But what are you going to do if you decide to support both AmigaOS and Neurtino or what-ever? >>> And, how do I have to do the memory allocation? >> The files example1.c and example2.c show you how with descriptive >> comments. > Great! You had a lot of time to write all those comments, didn't you? ;-) I typed quickly. :) >> The files main.c, database.c and database.h demonstrate a *very* simple >> database using an array of pointers. The front-end to the program is a bit >> grotty, but it was only ment to be a quick example. The array of pointers >> is automatically resized when required. One advantage of implementing a >> database like this is fast sort times you can achieve, because only >> pointers are moved, not database records. > Cool, another interesting method. But I think the linked-lists method is the > best one. Think about sorting and searching. These could become you're two biggest performance killers. Perhaps these suggestions might help you; 1) When sorting your list, move the pointers instead of the actual nodes. 2) Use a doubly-linked list to traverse the database in either direction. 3) Insert items in to your list in sorted order. This will make it un-necessary to sort the list unless you need to change the sort critera. 4) Implement a binary search to find entries in your sorted list - instead of iterating from head to tail to find an item. 5) Oh yeah, have fun! >> An array of pointers does not consume very much memory. It would therefore >> be possible to have several arrays. Each one for referencing the database >> sorted on different keys. > But even if it is only a small amount of memory it shouldn't be necessary, > so I think I'll try the linked-list method. It's not necessary! It was just an idea to improve the sorting speed of your database. Especially if you are going to do sorts on different fields often. Kind Regards Nathan @ENDNODE @NODE "Mail_124" " Re: Begginners-question regarding memory allocation " From: Ilkka Lehtoranta Date: 01-31-00 00:28:13 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: Ilkka Lehtoranta Hello Stephan On 30-Tam-00, you wrote: SH> BTW: What's the best autodoc-viewer? Maybe with converting them to SH> AmigaGuide? Would help me much to find infos faster. Get Amiga Developer CD... There you can find includes & autodocs in AmigaGuide format. And lots of other developer material :) @ENDNODE @NODE "Mail_125" " Re: Mui future. " From: Ilkka Lehtoranta Date: 01-31-00 00:51:11 Subject: @{b}Re: Mui future.@{ub} From: Ilkka Lehtoranta Hello Vincent On 30-Tam-00, you wrote: VM> From: Vincent Morenas VM> Hello, VM> Does someone could tell me if the author of MUI plan to produce a 3.9 VM> or 4.0 Version ?? AFAIK Stuntz is still developing MUI. But don't ask when 3.9 or 4.0 is out: no one knows. @ENDNODE @NODE "Mail_126" " Re: Begginners-question regarding memory allocation " From: roderick_maclean@agilent.com Date: 01-31-00 10:45:45 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: roderick_maclean@agilent.com > Yeah, but I think I will need some kind of "identifier" for each > piece of memory.But Tim Hanson has kindly written some code-lines, > will have a deeper look on that and see if it solves the problem... What happens internally is that each name you declare hooks up with a variable address. Your pointer variables will point to the data you want to store. If you want to set up a linked list then the linked list structure will contain the data variables AND a pointer to the same type of linked list structure. This way you can chain your data together into a continuous 'list'. You can step through the list one item at a time to look for the data that you want. As far as pointer variables are concerned, you only need to worry about the address of the first item in the list and the address of the 'current' item in the list. So at a minimum you really only need two pointer variables. You might need 3 (or maybe 4) depending upon what you do with the list but these will probably just be temporary. If you're writing a database program, I really would suggest really learning pointer/memory stuff. Eventually you're going to want to store that data in some other structure (maybe a tree?) (or worse, you might need to reference the same data from a variety of different structures) Good luck! I hope some of this made sense! Rod MacLean | Roderick_MacLean@agilent.com Developer - Agilent Technologies | +44 (0131) 331-7304 ** My views do not necessarily reflect the views of Agilent! ** @ENDNODE @NODE "Mail_127" " Re: Begginners-question regarding memory allocation " From: roderick_maclean@agilent.com Date: 01-31-00 13:20:14 Subject: @{b}Re: Begginners-question regarding memory allocation@{ub} From: roderick_maclean@agilent.com Nathan wrote: > Think about sorting and searching. These could become you're > two biggest performance killers. Perhaps these suggestions > might help you; > 1) When sorting your list, move the pointers instead of the > actual nodes. You can if you like... I would store the data in a structure similar to the Exec lists. You'll probably want to make the structure a two-way linked list. (You might even want to create a b-tree). I would leave the list alone during sorts and searches and instead I would create a copy of the list which contained only the elements which I was searching for. > 3) Insert items in to your list in sorted order. This will > make it un-necessary to sort the list unless you need to > change the sort critera. Good advice! Having your list pre-sorted into some kind of order is usually very important. For example DB of telephone numbers: pre-sort by surname. You can extract names easily (or at least find roughly the right place :) If you need to sort by area-code (or something) then one way to do it is to step through your original doubly-linked list, adding things a secondary dl-list in area order... Once you are finished manipulating the new list then zap all of the pointers - but make sure that your original list and the data are all intact/valid! > 4) Implement a binary search to find entries in your sorted > list - instead of iterating from head to tail to find an item. If you're looking for just one entry then you can do this. It's easy and you'll probably already know the algorithm ;) If you're looking for more than one entry then you can use this method to find one data item that fits your query. You have to expand on the algorithm in some way to get more than one hit. If you find that you need to do that kind of thing you should maybe consider using an existing db that you can interact with from within your program. (Using SQL or something?) It might save you as lot of coding time. (but I don't know how good SQL dbs and stuff are on the Amiga) > 5) Oh yeah, have fun! Anyone who gets into serious pointer stuff always has fun. You know the old saying "Time flies when you're having fun" It takes a long time to track down bugs ;) Rod MacLean | Roderick_MacLean@agilent.com Developer - Agilent Technologies | +44 (0131) 331-7304 ** My views do not necessarily reflect the views of Agilent! ** @ENDNODE @NODE "Mail_128" " "explode" image " From: andrewmarkwell@ukonline.co.uk Date: 01-31-00 15:43:56 Subject: @{b}"explode" image@{ub} From: andrewmarkwell@ukonline.co.uk Hiya, I have a window with a gadget in that brings up as ASL requester when you click on it. I was wondering if the image used in Intellifont (where you click on it to choose the location of fonts), was considered a standard for this kind of thing. I can't find any reference to it in the includes. If not, then what is a good thing to use? Maybe "..." like Windows? Andrew Markwell @ENDNODE @NODE "Mail_129" " Geek gadgets CD " From: Charles Barr Date: 01-31-00 17:26:14 Subject: @{b}Geek gadgets CD@{ub} From: Charles Barr Hello, Does anyone know of any companies that sell the geek gadgets CD. I just found out the weird science have stopped selling the CD. Or has anyone got a copy they might sell to me? Cheers @ENDNODE @NODE "Mail_130" " Telling when printing is stopped. " From: Charles Barr Date: 01-31-00 17:29:53 Subject: @{b}Telling when printing is stopped.@{ub} From: Charles Barr Hello, Is there any way of telling when the printer is stopped printing a file. what i do is send one text file to the PRT: I need some way of telling when the first file is finished. to send another one. Cheers @ENDNODE @NODE "Mail_131" " AW: Geek gadgets CD " From: Fritsch Alexander Date: 01-31-00 17:32:26 Subject: @{b}AW: Geek gadgets CD@{ub} From: Fritsch Alexander > Hello, > Does anyone know of any companies that sell the geek gadgets CD. > I just found out the weird science have stopped selling the CD. > Or has anyone got a copy they might sell to me? > Cheers > -- Did you try http://www.schatztruhe.de/inhalt.html ? The GG-CDs are still listed there. Kind regards Alexander Fritsch @ENDNODE @NODE "Mail_132" " Odp: Pattern dither in Adobe Photoshop, how and what? " From: Michal Bartczak Date: 01-31-00 19:08:25 Subject: @{b}Odp: Pattern dither in Adobe Photoshop, how and what?@{ub} From: "Michal Bartczak" > A friend of mine told me that Adobe Photoshop had a dither setting called > 'pattern' and that this gave rather good results -- does anybody know the > technique behind this? I don't have PS (nor a PC) so I can't test it myself, > and I didn't find anything useful when using Google to search the net... I know some dither routines, even some patented ones, and I'm not using APhotoshop, but pattern dither sounds like normal ordered dither for me ;) [or it can be modified ordered dither]. Anyway, best result for 256 colors are given by floyd&steinberg and similiar routines, if you need to know how - contact me, I'm quite experienced in this area. Michal @ENDNODE @NODE "Mail_133" " Hello there! I'm new here! ; From: fgloch@yahoo.com Date: 01-31-00 19:17:13 Subject: @{b}Hello there! I'm new here! ; )@{ub} From: fgloch@yahoo.com Hi there, I've just joined this list and I am just saying my hellos to you all. Kinds regards, Francis. @ENDNODE @NODE "Mail_134" " Bobs and GELS " From: Lee Atkins Date: 01-31-00 20:27:36 Subject: @{b}Bobs and GELS@{ub} From: Lee Atkins Hello, Imagine, if you will, a vertical wall on the right hand side of the screen. On the left is a Bob created and managed by the Gels system. When the bob is standing next to the wall after traveling from the right, the wall must change. I have done this by blitting the new gfx over the old wall image (the screen is double buffered and all gfx operations go to the hidden bitmap) The problem is the bob overlaps the wall and when the bob moves, the OS updates the bitmap from the buffer it stored previous to me blitting in new gfx. Is there a way of removing the Bob image, blitting the new stuff, then moving the bob. Also is the Gels system the best way to handle Bobs or is there a better Hope that made sense. @ENDNODE @NODE "Mail_135" " Re: Pattern dither in Adobe Photoshop, how and what? " From: Allan Odgaard Date: 01-31-00 20:33:13 Subject: @{b}Re: Pattern dither in Adobe Photoshop, how and what?@{ub} From: Allan Odgaard On 29-Jan-00, Alastair M. Robinson wrote: >> A friend of mine told me that Adobe Photoshop had a dither setting called >> 'pattern' and that this gave rather good results [...] > I've not used PhotoShop myself, but I seem to remember reading (and it has > been known for my memory to play tricks on me!) that Adobe hold a patent > on one of PhotoShop's dither methods. The term 'pattern dither' rings a > bell, so it could well have been this one. Did the article mention their technique? I believe that if they have a patent then they must have published the method in one way or another... > Is this query just out of interest, or do you need a dither method > yourself? If so, I might be able to help out. I'm author of ImageManager.library which currently offers random, ordered and FS dither, but I'm always interested in new schemes if they're any good :-) Regards Allan URL: http://www.DIKU.dk/students/duff/ Win95: "We made it safe to turn off your computer" @ENDNODE @NODE "Mail_136" " Re: "explode" image " From: Duane McDonnell Date: 01-31-00 21:29:45 Subject: @{b}Re: "explode" image@{ub} From: Duane McDonnell >From: andrewmarkwell@ukonline.co.uk >Hiya, >I have a window with a gadget in that brings up as ASL requester when you >click on it. I was wondering if the image used in Intellifont (where you >click on it to choose the location of fonts), was considered a standard for >this kind of thing. There is no standard support for this gadget type in Intuition, so the standard is whatever you define it to be :-) However, that type of image is quite common; many of the GUI builders include it or something like it for use. If you prefer to make your own you can use BOOPSI or even low level Intuition gadgets with the appropriate imagery rendered as you like. > I can't find any reference to it in the includes. If >not, then what is a good thing to use? Maybe "..." like Windows? I don't suppose it matters, as long as you're consistent. You could use a capital "F" or even ">>" or something like that. Maybe the Style Guide has something to say about this, but I don't have a copy handy. @ENDNODE